TagSoup - v3.2.0
    Preparing search index...

    Interface TokenizerOptions

    Options of the createTokenizer.

    interface TokenizerOptions {
        areCDATASectionsRecognized?: boolean;
        areProcessingInstructionsRecognized?: boolean;
        areSelfClosingTagsRecognized?: boolean;
        areTagNamesCaseInsensitive?: boolean;
        areUnbalancedEndTagsIgnored?: boolean;
        areUnbalancedStartTagsImplicitlyClosed?: boolean;
        foreignTags?: Record<string, ContextualTokenizerOptions>;
        implicitlyClosedTags?: Record<string, string[]>;
        implicitlyOpenedTags?: string[];
        isStrict?: boolean;
        rawTextTags?: string[];
        voidTags?: string[];
    }

    Hierarchy (View Summary)

    Index

    Properties

    areCDATASectionsRecognized?: boolean

    If true then CDATA sections are recognized.

    false
    
    areProcessingInstructionsRecognized?: boolean

    If true then processing instructions are recognized.

    false
    
    areSelfClosingTagsRecognized?: boolean

    If true then self-closing tags are recognized, otherwise they are treated as start tags.

    false
    
    areTagNamesCaseInsensitive?: boolean

    If true then ASCII alpha characters are case-insensitive in tag names.

    false
    
    areUnbalancedEndTagsIgnored?: boolean

    If true then end tags that don't have a corresponding start tag are ignored. Otherwise, a ParserError is thrown.

    Use in conjunctions with areUnbalancedStartTagsImplicitlyClosed.

    <a></b></a><a></a>
    ^^^^ b is ignored
    false
    
    areUnbalancedStartTagsImplicitlyClosed?: boolean

    If true then unbalanced start tags are forcefully closed. Otherwise, a ParserError is thrown.

    Use in conjunctions with areUnbalancedEndTagsIgnored.

    <a><b></a><a><b></b></a>
    ^^^^ b is implicitly closed
    false
    
    foreignTags?: Record<string, ContextualTokenizerOptions>

    The map from a foreign tag name to a tokenizer options applied to the tag children.

    implicitlyClosedTags?: Record<string, string[]>

    The map from a tag (A) to a list of tags that must be closed if tag (A) is opened.

    For example, in HTML p and h1 tags have the following semantics:

    <p><h1><p></p><h1></h1>
    ^^^^ p is implicitly closed by h1

    To achieve this behavior, set this option to:

    // h1 implicitly closes p
    { h1: ['p'] }

    Use in conjunctions with areUnbalancedStartTagsImplicitlyClosed.

    implicitlyOpenedTags?: string[]

    The list of tags for which a start tag is inserted if an unbalanced end tag is met. Otherwise, a ParserError is thrown.

    You can ignore unbalanced end tags with areUnbalancedEndTagsIgnored.

    For example, in HTML p and br tags follow this semantics:

    </p><p></p>
    ^^^ p is implicitly opened

    </br><br/>
    ^ br is implicitly opened

    To achieve this behavior, set this option to:

    ['p', 'br']
    
    isStrict?: boolean

    If true then tag names and attributes are processed with XML constraints.

    false
    
    rawTextTags?: string[]

    The list of tags which content is interpreted as plain text.

    ['script', 'style']
    
    voidTags?: string[]

    The list of tags that can't have any contents (since there's no end tag, no content can be put between the start tag and the end tag).

    ['link', 'meta']