es-html-parser
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -7,4 +7,4 @@ export declare enum NodeTypes { | ||
Comment = "Comment", | ||
CommentStart = "CommentStart", | ||
CommentEnd = "CommentEnd", | ||
CommentOpen = "CommentOpen", | ||
CommentClose = "CommentClose", | ||
CommentContent = "CommentContent", | ||
@@ -19,5 +19,5 @@ Attribute = "Attribute", | ||
OpenTagStart = "OpenTagStart", | ||
DoctypeStart = "DoctypeStart", | ||
DoctypeOpen = "DoctypeOpen", | ||
DoctypeAttribute = "DoctypeAttribute", | ||
DoctypeEnd = "DoctypeEnd", | ||
DoctypeClose = "DoctypeClose", | ||
ScriptTag = "ScriptTag", | ||
@@ -24,0 +24,0 @@ OpenScriptTagStart = "OpenScriptTagStart", |
@@ -11,4 +11,4 @@ "use strict"; | ||
NodeTypes["Comment"] = "Comment"; | ||
NodeTypes["CommentStart"] = "CommentStart"; | ||
NodeTypes["CommentEnd"] = "CommentEnd"; | ||
NodeTypes["CommentOpen"] = "CommentOpen"; | ||
NodeTypes["CommentClose"] = "CommentClose"; | ||
NodeTypes["CommentContent"] = "CommentContent"; | ||
@@ -23,5 +23,5 @@ NodeTypes["Attribute"] = "Attribute"; | ||
NodeTypes["OpenTagStart"] = "OpenTagStart"; | ||
NodeTypes["DoctypeStart"] = "DoctypeStart"; | ||
NodeTypes["DoctypeOpen"] = "DoctypeOpen"; | ||
NodeTypes["DoctypeAttribute"] = "DoctypeAttribute"; | ||
NodeTypes["DoctypeEnd"] = "DoctypeEnd"; | ||
NodeTypes["DoctypeClose"] = "DoctypeClose"; | ||
NodeTypes["ScriptTag"] = "ScriptTag"; | ||
@@ -28,0 +28,0 @@ NodeTypes["OpenScriptTagStart"] = "OpenScriptTagStart"; |
@@ -11,10 +11,10 @@ export declare enum TokenTypes { | ||
AttributeValueWrapperEnd = "AttributeValueWrapperEnd", | ||
DoctypeStart = "DoctypeStart", | ||
DoctypeOpen = "DoctypeOpen", | ||
DoctypeAttributeValue = "DoctypeAttributeValue", | ||
DoctypeAttributeWrapperStart = "DoctypeAttributeWrapperStart", | ||
DoctypeAttributeWrapperEnd = "DoctypeAttributeWrapperEnd", | ||
DoctypeEnd = "DoctypeEnd", | ||
CommentStart = "CommentStart", | ||
DoctypeClose = "DoctypeClose", | ||
CommentOpen = "CommentOpen", | ||
CommentContent = "CommentContent", | ||
CommentEnd = "CommentEnd", | ||
CommentClose = "CommentClose", | ||
OpenScriptTagStart = "OpenScriptTagStart", | ||
@@ -21,0 +21,0 @@ OpenScriptTagEnd = "OpenScriptTagEnd", |
@@ -15,10 +15,10 @@ "use strict"; | ||
TokenTypes["AttributeValueWrapperEnd"] = "AttributeValueWrapperEnd"; | ||
TokenTypes["DoctypeStart"] = "DoctypeStart"; | ||
TokenTypes["DoctypeOpen"] = "DoctypeOpen"; | ||
TokenTypes["DoctypeAttributeValue"] = "DoctypeAttributeValue"; | ||
TokenTypes["DoctypeAttributeWrapperStart"] = "DoctypeAttributeWrapperStart"; | ||
TokenTypes["DoctypeAttributeWrapperEnd"] = "DoctypeAttributeWrapperEnd"; | ||
TokenTypes["DoctypeEnd"] = "DoctypeEnd"; | ||
TokenTypes["CommentStart"] = "CommentStart"; | ||
TokenTypes["DoctypeClose"] = "DoctypeClose"; | ||
TokenTypes["CommentOpen"] = "CommentOpen"; | ||
TokenTypes["CommentContent"] = "CommentContent"; | ||
TokenTypes["CommentEnd"] = "CommentEnd"; | ||
TokenTypes["CommentClose"] = "CommentClose"; | ||
TokenTypes["OpenScriptTagStart"] = "OpenScriptTagStart"; | ||
@@ -25,0 +25,0 @@ TokenTypes["OpenScriptTagEnd"] = "OpenScriptTagEnd"; |
@@ -13,10 +13,10 @@ export declare enum TokenizerContextTypes { | ||
StyleContent = "StyleContent", | ||
DoctypeStart = "DoctypeStart", | ||
DoctypeEnd = "DoctypeEnd", | ||
DoctypeOpen = "DoctypeOpen", | ||
DoctypeClose = "DoctypeClose", | ||
DoctypeAttributes = "DoctypeAttributes", | ||
DoctypeAttributeWrapped = "DoctypeAttributeWrapped", | ||
DoctypeAttributeBare = "DoctypeAttributeBare", | ||
CommentStart = "CommentStart", | ||
CommentOpen = "CommentOpen", | ||
CommentContent = "CommentContent", | ||
CommentEnd = "CommentEnd" | ||
CommentClose = "CommentClose" | ||
} |
@@ -17,10 +17,10 @@ "use strict"; | ||
TokenizerContextTypes["StyleContent"] = "StyleContent"; | ||
TokenizerContextTypes["DoctypeStart"] = "DoctypeStart"; | ||
TokenizerContextTypes["DoctypeEnd"] = "DoctypeEnd"; | ||
TokenizerContextTypes["DoctypeOpen"] = "DoctypeOpen"; | ||
TokenizerContextTypes["DoctypeClose"] = "DoctypeClose"; | ||
TokenizerContextTypes["DoctypeAttributes"] = "DoctypeAttributes"; | ||
TokenizerContextTypes["DoctypeAttributeWrapped"] = "DoctypeAttributeWrapped"; | ||
TokenizerContextTypes["DoctypeAttributeBare"] = "DoctypeAttributeBare"; | ||
TokenizerContextTypes["CommentStart"] = "CommentStart"; | ||
TokenizerContextTypes["CommentOpen"] = "CommentOpen"; | ||
TokenizerContextTypes["CommentContent"] = "CommentContent"; | ||
TokenizerContextTypes["CommentEnd"] = "CommentEnd"; | ||
TokenizerContextTypes["CommentClose"] = "CommentClose"; | ||
})(TokenizerContextTypes = exports.TokenizerContextTypes || (exports.TokenizerContextTypes = {})); |
@@ -13,3 +13,3 @@ "use strict"; | ||
if (chars === COMMENT_END) { | ||
return parseCommentEnd(state, tokens); | ||
return parseCommentClose(state, tokens); | ||
} | ||
@@ -21,3 +21,3 @@ state.accumulatedContent += state.decisionBuffer; | ||
exports.parse = parse; | ||
function parseCommentEnd(state, tokens) { | ||
function parseCommentClose(state, tokens) { | ||
const position = (0, utils_1.calculateTokenPosition)(state, { keepBuffer: false }); | ||
@@ -35,3 +35,3 @@ const endRange = [ | ||
}, { | ||
type: constants_1.TokenTypes.CommentEnd, | ||
type: constants_1.TokenTypes.CommentClose, | ||
value: state.decisionBuffer, | ||
@@ -38,0 +38,0 @@ range: endRange, |
@@ -20,3 +20,3 @@ "use strict"; | ||
if (chars === COMMENT_START) { | ||
return parseCommentStart(state, tokens); | ||
return parseCommentOpen(state, tokens); | ||
} | ||
@@ -28,3 +28,3 @@ if (isIncompleteDoctype(chars)) { | ||
if (chars.toUpperCase() === "<!DOCTYPE") { | ||
return parseDoctypeStart(state, tokens); | ||
return parseDoctypeOpen(state, tokens); | ||
} | ||
@@ -86,3 +86,3 @@ state.accumulatedContent += state.decisionBuffer; | ||
} | ||
function parseCommentStart(state, tokens) { | ||
function parseCommentOpen(state, tokens) { | ||
if (state.accumulatedContent.length !== 0) { | ||
@@ -97,3 +97,3 @@ tokens.push(generateTextToken(state)); | ||
tokens.push({ | ||
type: constants_1.TokenTypes.CommentStart, | ||
type: constants_1.TokenTypes.CommentOpen, | ||
value: state.decisionBuffer, | ||
@@ -108,3 +108,3 @@ range: range, | ||
} | ||
function parseDoctypeStart(state, tokens) { | ||
function parseDoctypeOpen(state, tokens) { | ||
if (state.accumulatedContent.length !== 0) { | ||
@@ -115,4 +115,4 @@ tokens.push(generateTextToken(state)); | ||
state.decisionBuffer = ""; | ||
state.currentContext = constants_1.TokenizerContextTypes.DoctypeStart; | ||
state.currentContext = constants_1.TokenizerContextTypes.DoctypeOpen; | ||
state.caretPosition++; | ||
} |
@@ -50,3 +50,3 @@ "use strict"; | ||
state.decisionBuffer = ""; | ||
state.currentContext = constants_1.TokenizerContextTypes.DoctypeEnd; | ||
state.currentContext = constants_1.TokenizerContextTypes.DoctypeClose; | ||
} |
@@ -9,3 +9,3 @@ "use strict"; | ||
tokens.push({ | ||
type: constants_1.TokenTypes.DoctypeEnd, | ||
type: constants_1.TokenTypes.DoctypeClose, | ||
value: state.decisionBuffer, | ||
@@ -12,0 +12,0 @@ range: position.range, |
@@ -17,6 +17,6 @@ "use strict"; | ||
exports.parse = parse; | ||
function generateDoctypeStartToken(state) { | ||
function generateDoctypeOpenToken(state) { | ||
const position = (0, utils_1.calculateTokenPosition)(state, { keepBuffer: false }); | ||
return { | ||
type: constants_1.TokenTypes.DoctypeStart, | ||
type: constants_1.TokenTypes.DoctypeOpen, | ||
value: state.accumulatedContent, | ||
@@ -28,3 +28,3 @@ range: position.range, | ||
function parseWhitespace(state, tokens) { | ||
tokens.push(generateDoctypeStartToken(state)); | ||
tokens.push(generateDoctypeOpenToken(state)); | ||
state.accumulatedContent = ""; | ||
@@ -35,6 +35,6 @@ state.decisionBuffer = ""; | ||
function parseClosingCornerBrace(state, tokens) { | ||
tokens.push(generateDoctypeStartToken(state)); | ||
tokens.push(generateDoctypeOpenToken(state)); | ||
state.accumulatedContent = ""; | ||
state.decisionBuffer = ""; | ||
state.currentContext = constants_1.TokenizerContextTypes.DoctypeEnd; | ||
state.currentContext = constants_1.TokenizerContextTypes.DoctypeClose; | ||
} |
@@ -13,4 +13,4 @@ import { TokenizeHandler } from "../../types"; | ||
export * as doctypeAttributes from "./doctype-attributes"; | ||
export * as doctypeEnd from "./doctype-end"; | ||
export * as doctypeStart from "./doctype-start"; | ||
export * as DoctypeClose from "./doctype-end"; | ||
export * as DoctypeOpen from "./doctype-start"; | ||
export * as openTagEnd from "./open-tag-end"; | ||
@@ -17,0 +17,0 @@ export * as openTagStart from "./open-tag-start"; |
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.noop = exports.styleTagContent = exports.scriptTagContent = exports.openTagStart = exports.openTagEnd = exports.doctypeStart = exports.doctypeEnd = exports.doctypeAttributes = exports.doctypeAttributeWrapped = exports.doctypeAttributeBare = exports.data = exports.commentContent = exports.closeTag = exports.attributes = exports.attributeValue = exports.attributeValueWrapped = exports.attributeValueBare = exports.attributeKey = void 0; | ||
exports.noop = exports.styleTagContent = exports.scriptTagContent = exports.openTagStart = exports.openTagEnd = exports.DoctypeOpen = exports.DoctypeClose = exports.doctypeAttributes = exports.doctypeAttributeWrapped = exports.doctypeAttributeBare = exports.data = exports.commentContent = exports.closeTag = exports.attributes = exports.attributeValue = exports.attributeValueWrapped = exports.attributeValueBare = exports.attributeKey = void 0; | ||
exports.attributeKey = __importStar(require("./attribute-key")); | ||
@@ -39,4 +39,4 @@ exports.attributeValueBare = __importStar(require("./attribute-value-bare")); | ||
exports.doctypeAttributes = __importStar(require("./doctype-attributes")); | ||
exports.doctypeEnd = __importStar(require("./doctype-end")); | ||
exports.doctypeStart = __importStar(require("./doctype-start")); | ||
exports.DoctypeClose = __importStar(require("./doctype-end")); | ||
exports.DoctypeOpen = __importStar(require("./doctype-start")); | ||
exports.openTagEnd = __importStar(require("./open-tag-end")); | ||
@@ -43,0 +43,0 @@ exports.openTagStart = __importStar(require("./open-tag-start")); |
@@ -18,4 +18,4 @@ "use strict"; | ||
[constants_1.TokenizerContextTypes.StyleContent]: handlers_1.styleTagContent, | ||
[constants_1.TokenizerContextTypes.DoctypeStart]: handlers_1.doctypeStart, | ||
[constants_1.TokenizerContextTypes.DoctypeEnd]: handlers_1.doctypeEnd, | ||
[constants_1.TokenizerContextTypes.DoctypeOpen]: handlers_1.DoctypeOpen, | ||
[constants_1.TokenizerContextTypes.DoctypeClose]: handlers_1.DoctypeClose, | ||
[constants_1.TokenizerContextTypes.DoctypeAttributes]: handlers_1.doctypeAttributes, | ||
@@ -25,4 +25,4 @@ [constants_1.TokenizerContextTypes.DoctypeAttributeWrapped]: handlers_1.doctypeAttributeWrapped, | ||
[constants_1.TokenizerContextTypes.CommentContent]: handlers_1.commentContent, | ||
[constants_1.TokenizerContextTypes.CommentStart]: handlers_1.noop, | ||
[constants_1.TokenizerContextTypes.CommentEnd]: handlers_1.noop, | ||
[constants_1.TokenizerContextTypes.CommentOpen]: handlers_1.noop, | ||
[constants_1.TokenizerContextTypes.CommentClose]: handlers_1.noop, | ||
}; | ||
@@ -29,0 +29,0 @@ function tokenizeChars(chars, state, tokens, { isFinalChunk, positionOffset, }) { |
@@ -6,4 +6,4 @@ "use strict"; | ||
const utils_1 = require("../../utils"); | ||
function handleCommentStart(state, token) { | ||
state.currentNode.start = (0, utils_1.createNodeFrom)(token); | ||
function handleCommentOpen(state, token) { | ||
state.currentNode.open = (0, utils_1.createNodeFrom)(token); | ||
state.caretPosition++; | ||
@@ -17,4 +17,4 @@ return state; | ||
} | ||
function handleCommentEnd(state, token) { | ||
state.currentNode.end = (0, utils_1.createNodeFrom)(token); | ||
function handleCommentClose(state, token) { | ||
state.currentNode.close = (0, utils_1.createNodeFrom)(token); | ||
(0, utils_1.updateNodeEnd)(state.currentNode, token); | ||
@@ -27,4 +27,4 @@ state.currentNode = state.currentNode.parentRef; | ||
function construct(token, state) { | ||
if (token.type === constants_1.TokenTypes.CommentStart) { | ||
return handleCommentStart(state, token); | ||
if (token.type === constants_1.TokenTypes.CommentOpen) { | ||
return handleCommentOpen(state, token); | ||
} | ||
@@ -34,4 +34,4 @@ if (token.type === constants_1.TokenTypes.CommentContent) { | ||
} | ||
if (token.type === constants_1.TokenTypes.CommentEnd) { | ||
return handleCommentEnd(state, token); | ||
if (token.type === constants_1.TokenTypes.CommentClose) { | ||
return handleCommentClose(state, token); | ||
} | ||
@@ -38,0 +38,0 @@ state.caretPosition++; |
@@ -10,3 +10,3 @@ "use strict"; | ||
} | ||
function handleDoctypeEnd(state) { | ||
function handleDoctypeClose(state) { | ||
state.currentContext = state.currentContext.parentRef; | ||
@@ -48,4 +48,4 @@ return state; | ||
function construct(token, state) { | ||
if (token.type === constants_1.TokenTypes.DoctypeEnd) { | ||
return handleDoctypeEnd(state); | ||
if (token.type === constants_1.TokenTypes.DoctypeClose) { | ||
return handleDoctypeClose(state); | ||
} | ||
@@ -52,0 +52,0 @@ if (token.type === constants_1.TokenTypes.DoctypeAttributeWrapperStart) { |
@@ -10,3 +10,3 @@ "use strict"; | ||
]; | ||
function handleDoctypeEnd(state) { | ||
function handleDoctypeClose(state) { | ||
state.currentContext = state.currentContext.parentRef; | ||
@@ -30,4 +30,4 @@ return state; | ||
function construct(token, state) { | ||
if (token.type === constants_1.TokenTypes.DoctypeEnd) { | ||
return handleDoctypeEnd(state); | ||
if (token.type === constants_1.TokenTypes.DoctypeClose) { | ||
return handleDoctypeClose(state); | ||
} | ||
@@ -34,0 +34,0 @@ if (ATTRIBUTE_START_TOKENS.indexOf(token.type) !== -1) { |
@@ -10,9 +10,9 @@ "use strict"; | ||
]; | ||
function handleDoctypeStart(state, token) { | ||
state.currentNode.start = (0, utils_1.createNodeFrom)(token); | ||
function handleDoctypeOpen(state, token) { | ||
state.currentNode.open = (0, utils_1.createNodeFrom)(token); | ||
state.caretPosition++; | ||
return state; | ||
} | ||
function handleDoctypeEnd(state, token) { | ||
state.currentNode.end = (0, utils_1.createNodeFrom)(token); | ||
function handleDoctypeClose(state, token) { | ||
state.currentNode.close = (0, utils_1.createNodeFrom)(token); | ||
(0, utils_1.updateNodeEnd)(state.currentNode, token); | ||
@@ -32,7 +32,7 @@ state.currentNode = state.currentNode.parentRef; | ||
function construct(token, state) { | ||
if (token.type === constants_1.TokenTypes.DoctypeStart) { | ||
return handleDoctypeStart(state, token); | ||
if (token.type === constants_1.TokenTypes.DoctypeOpen) { | ||
return handleDoctypeOpen(state, token); | ||
} | ||
if (token.type === constants_1.TokenTypes.DoctypeEnd) { | ||
return handleDoctypeEnd(state, token); | ||
if (token.type === constants_1.TokenTypes.DoctypeClose) { | ||
return handleDoctypeClose(state, token); | ||
} | ||
@@ -39,0 +39,0 @@ if (ATTRIBUTES_START_TOKENS.indexOf(token.type) !== -1) { |
@@ -33,3 +33,3 @@ "use strict"; | ||
} | ||
function handleCommentStart(state, token) { | ||
function handleCommentOpen(state, token) { | ||
(0, utils_1.initChildrenIfNone)(state.currentNode); | ||
@@ -51,3 +51,3 @@ const commentNode = { | ||
} | ||
function handleDoctypeStart(state, token) { | ||
function handleDoctypeOpen(state, token) { | ||
(0, utils_1.initChildrenIfNone)(state.currentNode); | ||
@@ -129,7 +129,7 @@ const doctypeNode = { | ||
} | ||
if (token.type === constants_1.TokenTypes.CommentStart) { | ||
return handleCommentStart(state, token); | ||
if (token.type === constants_1.TokenTypes.CommentOpen) { | ||
return handleCommentOpen(state, token); | ||
} | ||
if (token.type === constants_1.TokenTypes.DoctypeStart) { | ||
return handleDoctypeStart(state, token); | ||
if (token.type === constants_1.TokenTypes.DoctypeOpen) { | ||
return handleDoctypeOpen(state, token); | ||
} | ||
@@ -136,0 +136,0 @@ state.caretPosition++; |
@@ -8,4 +8,4 @@ import { CommentNode, DoctypeNode, ScriptTagNode, StyleTagNode, TagNode, DocumentNode, AnyNode, AttributeNode } from "./node"; | ||
export declare type ContextualStyleTagNode = ContextualNode<StyleTagNode, "openStart" | "openEnd" | "value" | "close">; | ||
export declare type ContextualDoctypeNode = ContextualNode<DoctypeNode, "start" | "end">; | ||
export declare type ContextualCommentNode = ContextualNode<CommentNode, "start" | "end" | "value">; | ||
export declare type ContextualDoctypeNode = ContextualNode<DoctypeNode, "open" | "close">; | ||
export declare type ContextualCommentNode = ContextualNode<CommentNode, "open" | "close" | "value">; | ||
export declare type ContextualTagNode = ContextualNode<TagNode, "close" | "selfClosing" | "name" | "openEnd" | "openStart"> & { | ||
@@ -12,0 +12,0 @@ children: Array<ContextualScriptTagNode | ContextualStyleTagNode | ContextualDoctypeNode | ContextualCommentNode | ContextualTagNode | TagNode["children"][number]>; |
@@ -59,17 +59,17 @@ import { NodeTypes } from "../constants"; | ||
type: NodeTypes.Comment; | ||
start: CommentStartNode; | ||
end: CommentEndNode; | ||
open: CommentOpenNode; | ||
close: CommentCloseNode; | ||
value: CommentContentNode; | ||
} | ||
export declare type CommentStartNode = SimpleNode<NodeTypes.CommentStart>; | ||
export declare type CommentEndNode = SimpleNode<NodeTypes.CommentEnd>; | ||
export declare type CommentOpenNode = SimpleNode<NodeTypes.CommentOpen>; | ||
export declare type CommentCloseNode = SimpleNode<NodeTypes.CommentClose>; | ||
export declare type CommentContentNode = SimpleNode<NodeTypes.CommentContent>; | ||
export interface DoctypeNode extends BaseNode { | ||
type: NodeTypes.Doctype; | ||
start: DoctypeStartNode; | ||
end: DoctypeEndNode; | ||
open: DoctypeOpenNode; | ||
close: DoctypeCloseNode; | ||
attributes: DoctypeAttributeNode[]; | ||
} | ||
export declare type DoctypeStartNode = SimpleNode<NodeTypes.DoctypeStart>; | ||
export declare type DoctypeEndNode = SimpleNode<NodeTypes.DoctypeEnd>; | ||
export declare type DoctypeOpenNode = SimpleNode<NodeTypes.DoctypeOpen>; | ||
export declare type DoctypeCloseNode = SimpleNode<NodeTypes.DoctypeClose>; | ||
export interface DoctypeAttributeNode extends BaseNode { | ||
@@ -84,2 +84,2 @@ type: NodeTypes.DoctypeAttribute; | ||
export declare type DoctypeAttributeWrapperEnd = SimpleNode<NodeTypes.DoctypeAttributeWrapperEnd>; | ||
export declare type AnyNode = DocumentNode | TextNode | TagNode | OpenTagStartNode | OpenTagEndNode | CloseTagNode | AttributeNode | AttributeKeyNode | AttributeValueNode | AttributeValueWrapperStartNode | AttributeValueWrapperEndNode | ScriptTagNode | OpenScriptTagStartNode | CloseScriptTagNode | OpenScriptTagEndNode | ScriptTagContentNode | StyleTagNode | OpenStyleTagStartNode | OpenStyleTagEndNode | StyleTagContentNode | CloseStyleTagNode | CommentNode | CommentStartNode | CommentEndNode | CommentContentNode | DoctypeNode | DoctypeStartNode | DoctypeEndNode | DoctypeAttributeNode | DoctypeAttributeValueNode | DoctypeAttributeWrapperStart | DoctypeAttributeWrapperEnd; | ||
export declare type AnyNode = DocumentNode | TextNode | TagNode | OpenTagStartNode | OpenTagEndNode | CloseTagNode | AttributeNode | AttributeKeyNode | AttributeValueNode | AttributeValueWrapperStartNode | AttributeValueWrapperEndNode | ScriptTagNode | OpenScriptTagStartNode | CloseScriptTagNode | OpenScriptTagEndNode | ScriptTagContentNode | StyleTagNode | OpenStyleTagStartNode | OpenStyleTagEndNode | StyleTagContentNode | CloseStyleTagNode | CommentNode | CommentOpenNode | CommentCloseNode | CommentContentNode | DoctypeNode | DoctypeOpenNode | DoctypeCloseNode | DoctypeAttributeNode | DoctypeAttributeValueNode | DoctypeAttributeWrapperStart | DoctypeAttributeWrapperEnd; |
@@ -10,2 +10,2 @@ import { TokenTypes } from "../constants"; | ||
} | ||
export declare type AnyToken = Token<TokenTypes.Text> | Token<TokenTypes.OpenTagStart> | Token<TokenTypes.OpenTagEnd> | Token<TokenTypes.CloseTag> | Token<TokenTypes.AttributeKey> | Token<TokenTypes.AttributeAssignment> | Token<TokenTypes.AttributeValueWrapperStart> | Token<TokenTypes.AttributeValue> | Token<TokenTypes.AttributeValueWrapperEnd> | Token<TokenTypes.DoctypeStart> | Token<TokenTypes.DoctypeAttributeValue> | Token<TokenTypes.DoctypeAttributeWrapperStart> | Token<TokenTypes.DoctypeAttributeWrapperEnd> | Token<TokenTypes.DoctypeEnd> | Token<TokenTypes.CommentStart> | Token<TokenTypes.CommentContent> | Token<TokenTypes.CommentEnd> | Token<TokenTypes.OpenScriptTagStart> | Token<TokenTypes.OpenScriptTagEnd> | Token<TokenTypes.ScriptTagContent> | Token<TokenTypes.CloseScriptTag> | Token<TokenTypes.OpenStyleTagStart> | Token<TokenTypes.OpenStyleTagEnd> | Token<TokenTypes.StyleTagContent> | Token<TokenTypes.CloseStyleTag>; | ||
export declare type AnyToken = Token<TokenTypes.Text> | Token<TokenTypes.OpenTagStart> | Token<TokenTypes.OpenTagEnd> | Token<TokenTypes.CloseTag> | Token<TokenTypes.AttributeKey> | Token<TokenTypes.AttributeAssignment> | Token<TokenTypes.AttributeValueWrapperStart> | Token<TokenTypes.AttributeValue> | Token<TokenTypes.AttributeValueWrapperEnd> | Token<TokenTypes.DoctypeOpen> | Token<TokenTypes.DoctypeAttributeValue> | Token<TokenTypes.DoctypeAttributeWrapperStart> | Token<TokenTypes.DoctypeAttributeWrapperEnd> | Token<TokenTypes.DoctypeClose> | Token<TokenTypes.CommentOpen> | Token<TokenTypes.CommentContent> | Token<TokenTypes.CommentClose> | Token<TokenTypes.OpenScriptTagStart> | Token<TokenTypes.OpenScriptTagEnd> | Token<TokenTypes.ScriptTagContent> | Token<TokenTypes.CloseScriptTag> | Token<TokenTypes.OpenStyleTagStart> | Token<TokenTypes.OpenStyleTagEnd> | Token<TokenTypes.StyleTagContent> | Token<TokenTypes.CloseStyleTag>; |
{ | ||
"name": "es-html-parser", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
# ES HTML Parser | ||
<p align="left"> | ||
<img src="https://github.com/yeonjuan/es-html-parser/actions/workflows/main.yml/badge.svg?branch=main" alt="CI Badge" /> | ||
@@ -10,2 +11,3 @@ <a href="https://codecov.io/gh/yeonjuan/es-html-parser" > | ||
</a> | ||
</p> | ||
@@ -110,8 +112,8 @@ ES HTML Parser is an HTML parser that generates an abstract syntax tree similar to the ESTree specification. | ||
| CommentNode | ||
| CommentStartNode | ||
| CommentEndNode | ||
| CommentOpenNode | ||
| CommentCloseNode | ||
| CommentContentNode | ||
| DoctypeNode | ||
| DoctypeStartNode | ||
| DoctypeEndNode | ||
| DoctypeOpenNode | ||
| DoctypeCloseNode | ||
| DoctypeAttributeNode | ||
@@ -138,10 +140,10 @@ | DoctypeAttributeValueNode | ||
| Token<TokenTypes.AttributeValueWrapperEnd> | ||
| Token<TokenTypes.DoctypeStart> | ||
| Token<TokenTypes.DoctypeOpen> | ||
| Token<TokenTypes.DoctypeAttributeValue> | ||
| Token<TokenTypes.DoctypeAttributeWrapperStart> | ||
| Token<TokenTypes.DoctypeAttributeWrapperEnd> | ||
| Token<TokenTypes.DoctypeEnd> | ||
| Token<TokenTypes.CommentStart> | ||
| Token<TokenTypes.DoctypeClose> | ||
| Token<TokenTypes.CommentOpen> | ||
| Token<TokenTypes.CommentContent> | ||
| Token<TokenTypes.CommentEnd> | ||
| Token<TokenTypes.CommentClose> | ||
| Token<TokenTypes.OpenScriptTagStart> | ||
@@ -172,10 +174,10 @@ | Token<TokenTypes.OpenScriptTagEnd> | ||
AttributeValueWrapperEnd = "AttributeValueWrapperEnd", | ||
DoctypeStart = "DoctypeStart", | ||
DoctypeOpen = "DoctypeOpen", | ||
DoctypeAttributeValue = "DoctypeAttributeValue", | ||
DoctypeAttributeWrapperStart = "DoctypeAttributeWrapperStart", | ||
DoctypeAttributeWrapperEnd = "DoctypeAttributeWrapperEnd", | ||
DoctypeEnd = "DoctypeEnd", | ||
CommentStart = "CommentStart", | ||
DoctypeClose = "DoctypeClose", | ||
CommentOpen = "CommentOpen", | ||
CommentContent = "CommentContent", | ||
CommentEnd = "CommentEnd", | ||
CommentClose = "CommentClose", | ||
OpenScriptTagStart = "OpenScriptTagStart", | ||
@@ -201,4 +203,4 @@ OpenScriptTagEnd = "OpenScriptTagEnd", | ||
Comment = "Comment", | ||
CommentStart = "CommentStart", | ||
CommentEnd = "CommentEnd", | ||
CommentOpen = "CommentOpen", | ||
CommentClose = "CommentClose", | ||
CommentContent = "CommentContent", | ||
@@ -213,5 +215,5 @@ Attribute = "Attribute", | ||
OpenTagStart = "OpenTagStart", | ||
DoctypeStart = "DoctypeStart", | ||
DoctypeOpen = "DoctypeOpen", | ||
DoctypeAttribute = "DoctypeAttribute", | ||
DoctypeEnd = "DoctypeEnd", | ||
DoctypeClose = "DoctypeClose", | ||
ScriptTag = "ScriptTag", | ||
@@ -264,8 +266,8 @@ OpenScriptTagStart = "OpenScriptTagStart", | ||
- [CommentNode](#commentnode) | ||
- [CommentStartNode](#commentstartnode) | ||
- [CommentEndNode](#commentendnode) | ||
- [CommentOpenNode](#commentopennode) | ||
- [CommentCloseNode](#commentclosenode) | ||
- [CommentContentNode](#commentcontentnode) | ||
- [DoctypeNode](#doctypenode) | ||
- [DoctypeStartNode](#doctypestartnode) | ||
- [DoctypeEndNode](#doctypeendnode) | ||
- [DoctypeOpenNode](#doctypeopennode) | ||
- [DoctypeCloseNode](#doctypeclosenode) | ||
- [DoctypeAttributeNode](#doctypeattributenode) | ||
@@ -585,4 +587,4 @@ - [DoctypeAttributeValueNode](#doctypeattributevaluenode) | ||
type: "Comment"; | ||
start: CommentStartNode; | ||
end: CommentEndNode; | ||
open: CommentOpenNode; | ||
close: CommentCloseNode; | ||
value: CommentContentNode; | ||
@@ -592,9 +594,9 @@ } | ||
#### CommentStartNode | ||
#### CommentOpenNode | ||
`CommentStartNode` represents comment start character sequence. (e.g. `<!--`) | ||
`CommentOpenNode` represents comment start character sequence. (e.g. `<!--`) | ||
```ts | ||
interface CommentStartNode extends BaseNode { | ||
type: "CommentStart"; | ||
interface CommentOpenNode extends BaseNode { | ||
type: "CommentOpen"; | ||
value: string; | ||
@@ -604,9 +606,9 @@ } | ||
#### CommentEndNode | ||
#### CommentCloseNode | ||
`CommentEndNode` represents comment end character sequence. (e.g. `-->`) | ||
`CommentCloseNode` represents comment end character sequence. (e.g. `-->`) | ||
```ts | ||
interface CommentEndNode extends BaseNode { | ||
type: "CommentEnd"; | ||
interface CommentCloseNode extends BaseNode { | ||
type: "CommentClose"; | ||
value: string; | ||
@@ -635,14 +637,14 @@ } | ||
attributes: Array<DoctypeAttributeNode>; | ||
start: DoctypeStartNode; | ||
end: DoctypeEndNode; | ||
open: DoctypeOpenNode; | ||
close: DoctypeCloseNode; | ||
} | ||
``` | ||
#### DoctypeStartNode | ||
#### DoctypeOpenNode | ||
`DoctypeStartNode` represents character sequence of doctype start . (`<!DOCTYPE`) | ||
`DoctypeOpenNode` represents character sequence of doctype start . (`<!DOCTYPE`) | ||
```ts | ||
interface DoctypeStartNode extends BaseNode { | ||
type: "DoctypeStart"; | ||
interface DoctypeOpenNode extends BaseNode { | ||
type: "DoctypeOpen"; | ||
value: string; | ||
@@ -652,9 +654,9 @@ } | ||
#### DoctypeEndNode | ||
#### DoctypeCloseNode | ||
`DoctypeEndNode` represents the doctype end character sequence (e.g. `>`) | ||
`DoctypeCloseNode` represents the doctype end character sequence (e.g. `>`) | ||
```ts | ||
interface DoctypeEndNode extends BaseNode { | ||
type: "DoctypeEnd"; | ||
interface DoctypeCloseNode extends BaseNode { | ||
type: "DoctypeClose"; | ||
value: string; | ||
@@ -661,0 +663,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
125445
702