simple-html-tokenizer
Version:
Simple HTML Tokenizer is a lightweight JavaScript library that can be used to tokenize the kind of HTML normally found in templates.
6 lines (5 loc) • 2.24 kB
TypeScript
/**
* generated from https://raw.githubusercontent.com/w3c/html/2ef7a579bcfd2693b98df35f20e51dff60e3fbef/sections/syntax.include
* do not edit
*/
export type TokenizerState = 'beforeData' | 'data' | 'rcdata' | 'rawtext' | 'scriptData' | 'plaintext' | 'tagOpen' | 'endTagOpen' | 'tagName' | 'endTagName' | 'rcdataLessThanSign' | 'rcdataEndTagOpen' | 'rcdataEndTagName' | 'rawtextLessThanSign' | 'rawtextEndTagOpen' | 'rawtextEndTagName' | 'scriptDataLessThanSign' | 'scriptDataEndTagOpen' | 'scriptDataEndTagName' | 'scriptDataEscapeStart' | 'scriptDataEscapeStartDash' | 'scriptDataEscaped' | 'scriptDataEscapedDash' | 'scriptDataEscapedDashDash' | 'scriptDataEscapedLessThanSign' | 'scriptDataEscapedEndTagOpen' | 'scriptDataEscapedEndTagName' | 'scriptDataDoubleEscapeStart' | 'scriptDataDoubleEscaped' | 'scriptDataDoubleEscapedDash' | 'scriptDataDoubleEscapedDashDash' | 'scriptDataDoubleEscapedLessThanSign' | 'scriptDataDoubleEscapeEnd' | 'beforeAttributeName' | 'attributeName' | 'afterAttributeName' | 'beforeAttributeValue' | 'attributeValueDoubleQuoted' | 'attributeValueSingleQuoted' | 'attributeValueUnquoted' | 'afterAttributeValueQuoted' | 'selfClosingStartTag' | 'bogusComment' | 'markupDeclarationOpen' | 'commentStart' | 'commentStartDash' | 'comment' | 'commentLessThanSign' | 'commentLessThanSignBang' | 'commentLessThanSignBangDash' | 'commentLessThanSignBangDashDash' | 'commentEndDash' | 'commentEnd' | 'commentEndBang' | 'doctype' | 'beforeDoctypeName' | 'doctypeName' | 'afterDoctypeName' | 'afterDoctypePublicKeyword' | 'beforeDoctypePublicIdentifier' | 'doctypePublicIdentifierDoubleQuoted' | 'doctypePublicIdentifierSingleQuoted' | 'afterDoctypePublicIdentifier' | 'betweenDoctypePublicAndSystemIdentifiers' | 'afterDoctypeSystemKeyword' | 'beforeDoctypeSystemIdentifier' | 'doctypeSystemIdentifierDoubleQuoted' | 'doctypeSystemIdentifierSingleQuoted' | 'afterDoctypeSystemIdentifier' | 'bogusDoctype' | 'cdataSection' | 'cdataSectionBracket' | 'cdataSectionEnd' | 'characterReference' | 'numericCharacterReference' | 'hexadecimalCharacterReferenceStart' | 'decimalCharacterReferenceStart' | 'hexadecimalCharacterReference' | 'decimalCharacterReference' | 'numericCharacterReferenceEnd' | 'characterReferenceEnd';