@markuplint/html-parser
Advanced tools
Comparing version 3.0.0-alpha.0 to 3.0.0-alpha.1
@@ -59,2 +59,3 @@ "use strict"; | ||
namespace: getNamespace(originNode), | ||
elementType: 'html', | ||
attributes: [], | ||
@@ -70,3 +71,2 @@ hasSpreadAttr: false, | ||
isGhost: true, | ||
isCustomElement: false, | ||
}; | ||
@@ -151,3 +151,2 @@ node.childNodes = createTreeRecursive(originNode, node, rawHtml, offsetOffset, offsetLine, offsetColumn); | ||
const tagName = tagTokens.tagName; | ||
const isCustomElement = (0, parser_utils_1.isPotentialCustomElementName)(tagName); | ||
let endTag = null; | ||
@@ -195,3 +194,2 @@ let endTagLoc = 'endTag' in location ? location.endTag : null; | ||
tagCloseChar: '>', | ||
isCustomElement, | ||
}; | ||
@@ -214,2 +212,3 @@ } | ||
namespace: getNamespace(originNode), | ||
elementType: (0, parser_utils_1.detectElementType)(tagName), | ||
attributes: tagTokens.attrs, | ||
@@ -227,3 +226,2 @@ hasSpreadAttr: false, | ||
tagCloseChar: '>', | ||
isCustomElement, | ||
}; | ||
@@ -230,0 +228,0 @@ if (endTag) { |
@@ -49,3 +49,3 @@ "use strict"; | ||
if (node.type === 'starttag') { | ||
node.isCustomElement = false; | ||
node.elementType = 'html'; | ||
} | ||
@@ -52,0 +52,0 @@ }); |
@@ -20,4 +20,4 @@ "use strict"; | ||
// eslint-disable-next-line no-control-regex | ||
const tagNameSplited = tagWithAttrs.split(/[\u0000\u0009\u000A\u000C\u0020/>]/); | ||
const tagName = tagNameSplited[0] || tagNameSplited[1]; | ||
const tagNameSplitted = tagWithAttrs.split(/[\u0000\u0009\u000A\u000C\u0020/>]/); | ||
const tagName = tagNameSplitted[0] || tagNameSplitted[1]; | ||
if (!tagName || (!const_1.reTagName.test(tagName) && !(0, parser_utils_1.isPotentialCustomElementName)(tagName))) { | ||
@@ -24,0 +24,0 @@ throw new SyntaxError(`Invalid tag name: "${tagName}" in <${tagWithAttrs}>`); |
@@ -10,4 +10,5 @@ "use strict"; | ||
const optimize_starts_head_or_body_1 = require("./optimize-starts-head-or-body"); | ||
const parse = (rawCode, offsetOffset = 0, offsetLine = 0, offsetColumn = 0, isIgnoringFrontMatter) => { | ||
if (isIgnoringFrontMatter) { | ||
const parse = (rawCode, options) => { | ||
var _a, _b, _c; | ||
if (options === null || options === void 0 ? void 0 : options.ignoreFrontMatter) { | ||
rawCode = (0, parser_utils_1.ignoreFrontMatter)(rawCode); | ||
@@ -20,3 +21,3 @@ } | ||
} | ||
const nodeTree = (0, create_tree_1.createTree)(rawCode, isFragment, offsetOffset, offsetLine, offsetColumn); | ||
const nodeTree = (0, create_tree_1.createTree)(rawCode, isFragment, (_a = options === null || options === void 0 ? void 0 : options.offsetOffset) !== null && _a !== void 0 ? _a : 0, (_b = options === null || options === void 0 ? void 0 : options.offsetLine) !== null && _b !== void 0 ? _b : 0, (_c = options === null || options === void 0 ? void 0 : options.offsetColumn) !== null && _c !== void 0 ? _c : 0); | ||
const nodeList = (0, flatten_nodes_1.flattenNodes)(nodeTree, rawCode); | ||
@@ -23,0 +24,0 @@ if (data) { |
{ | ||
"name": "@markuplint/html-parser", | ||
"version": "3.0.0-alpha.0", | ||
"version": "3.0.0-alpha.1", | ||
"description": "HTML parser for markuplint", | ||
@@ -19,12 +19,9 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
}, | ||
"devDependencies": { | ||
"@types/parse5": "^6.0.3" | ||
}, | ||
"dependencies": { | ||
"@markuplint/ml-ast": "3.0.0-alpha.0", | ||
"@markuplint/parser-utils": "3.0.0-alpha.0", | ||
"parse5": "^6.0.1", | ||
"tslib": "^2.3.1" | ||
"@markuplint/ml-ast": "3.0.0-alpha.1", | ||
"@markuplint/parser-utils": "3.0.0-alpha.1", | ||
"parse5": "6", | ||
"tslib": "^2.4.0" | ||
}, | ||
"gitHead": "d32c522e016888e20bcbb5f09352c006b964f193" | ||
"gitHead": "56de89456146a06777eb5b6d4e8ba456147dd18b" | ||
} |
Sorry, the diff of this file is not supported yet
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
98866
0
+ Added@markuplint/ml-ast@3.0.0-alpha.1(transitive)
+ Added@markuplint/parser-utils@3.0.0-alpha.1(transitive)
+ Added@markuplint/types@3.0.0-alpha.1(transitive)
- Removed@markuplint/ml-ast@3.0.0-alpha.0(transitive)
- Removed@markuplint/parser-utils@3.0.0-alpha.0(transitive)
- Removed@markuplint/types@3.0.0-alpha.0(transitive)
Updatedparse5@6
Updatedtslib@^2.4.0