@markuplint/parser-utils
Advanced tools
Comparing version 2.0.0-dev.20211115.0 to 2.0.0-dev.20211213.0
export declare const MASK_CHAR = "\uE000"; | ||
export declare const rePCEN: RegExp; | ||
/** | ||
@@ -4,0 +3,0 @@ * SVG Element list |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.svgElementList = exports.rePCEN = exports.MASK_CHAR = void 0; | ||
exports.svgElementList = exports.MASK_CHAR = void 0; | ||
exports.MASK_CHAR = '\uE000'; | ||
/** | ||
* PotentialCustomElementName | ||
* | ||
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#prod-potentialcustomelementname | ||
* | ||
* > PotentialCustomElementName ::= | ||
* > [a-z] (PCENChar)* '-' (PCENChar)* | ||
* > PCENChar ::= | ||
* > "-" | "." | [0-9] | "_" | [a-z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] | | ||
* > [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] | ||
* > This uses the EBNF notation from the XML specification. [XML] | ||
* | ||
* ASCII-case-insensitively. | ||
* Originally, it is not possible to define a name including ASCII upper alphas in the custom element, but it is not treated as illegal by the HTML parser. | ||
*/ | ||
const rePCENChar = [ | ||
'\\-', | ||
'\\.', | ||
'[0-9]', | ||
'_', | ||
'[a-z]', | ||
'\u00B7', | ||
'[\u00C0-\u00D6]', | ||
'[\u00D8-\u00F6]', | ||
'[\u00F8-\u037D]', | ||
'[\u037F-\u1FFF]', | ||
'[\u200C-\u200D]', | ||
'[\u203F-\u2040]', | ||
'[\u2070-\u218F]', | ||
'[\u2C00-\u2FEF]', | ||
'[\u3001-\uD7FF]', | ||
'[\uF900-\uFDCF]', | ||
'[\uFDF0-\uFFFD]', | ||
'[\uD800-\uDBFF][\uDC00-\uDFFF]', | ||
].join('|'); | ||
exports.rePCEN = new RegExp(`^[a-z](?:${rePCENChar})*\\-(?:${rePCENChar})*$`, 'i'); | ||
/** | ||
* SVG Element list | ||
@@ -43,0 +7,0 @@ * |
@@ -8,23 +8,2 @@ /** | ||
export declare function isSVGElement(nodeName: string): boolean; | ||
/** | ||
* valid name of custom element | ||
* | ||
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name | ||
* | ||
* > - name must match the [PotentialCustomElementName](https://html.spec.whatwg.org/multipage/custom-elements.html#prod-potentialcustomelementname) production | ||
* > - name must not be any of the following: | ||
* > - `<annotation-xml>` | ||
* > - `<color-profile>` | ||
* > - `<font-face>` | ||
* > - `<font-face-src>` | ||
* > - `<font-face-uri>` | ||
* > - `<font-face-format>` | ||
* > - `<font-face-name>` | ||
* > - `<missing-glyph>` | ||
* | ||
* ASCII-case-insensitively. | ||
* Originally, it is not possible to define a name including ASCII upper alphas in the custom element, but it is not treated as illegal by the HTML parser. | ||
* | ||
* @param tagName | ||
*/ | ||
export declare function isPotentialCustomElementName(tagName: string): boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isPotentialCustomElementName = exports.isSVGElement = void 0; | ||
const types_1 = require("@markuplint/types"); | ||
const const_1 = require("./const"); | ||
@@ -15,38 +16,6 @@ /** | ||
exports.isSVGElement = isSVGElement; | ||
/** | ||
* valid name of custom element | ||
* | ||
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name | ||
* | ||
* > - name must match the [PotentialCustomElementName](https://html.spec.whatwg.org/multipage/custom-elements.html#prod-potentialcustomelementname) production | ||
* > - name must not be any of the following: | ||
* > - `<annotation-xml>` | ||
* > - `<color-profile>` | ||
* > - `<font-face>` | ||
* > - `<font-face-src>` | ||
* > - `<font-face-uri>` | ||
* > - `<font-face-format>` | ||
* > - `<font-face-name>` | ||
* > - `<missing-glyph>` | ||
* | ||
* ASCII-case-insensitively. | ||
* Originally, it is not possible to define a name including ASCII upper alphas in the custom element, but it is not treated as illegal by the HTML parser. | ||
* | ||
* @param tagName | ||
*/ | ||
const isCEN = (0, types_1.isCustomElementName)(); | ||
function isPotentialCustomElementName(tagName) { | ||
switch (tagName) { | ||
case 'annotation-xml': | ||
case 'color-profile': | ||
case 'font-face': | ||
case 'font-face-src': | ||
case 'font-face-uri': | ||
case 'font-face-format': | ||
case 'font-face-name': | ||
case 'missing-glyph': { | ||
return false; | ||
} | ||
} | ||
return const_1.rePCEN.test(tagName); | ||
return isCEN(tagName); | ||
} | ||
exports.isPotentialCustomElementName = isPotentialCustomElementName; |
{ | ||
"name": "@markuplint/parser-utils", | ||
"version": "2.0.0-dev.20211115.0", | ||
"version": "2.0.0-dev.20211213.0", | ||
"description": "Utility module for markuplint parser plugin", | ||
@@ -22,7 +22,8 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
"dependencies": { | ||
"@markuplint/ml-ast": "^2.0.0-dev.20211115.0", | ||
"@markuplint/ml-ast": "2.0.0-dev.20211115.1", | ||
"@markuplint/types": "1.0.0-dev.20211213.0", | ||
"tslib": "^2.3.1", | ||
"uuid": "^8.3.2" | ||
}, | ||
"gitHead": "11bcb81138ae11362add9b502124011735cc784a" | ||
"gitHead": "8f4682ca3e0937082af8c39b999443afa4a1aef3" | ||
} |
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
75115
4
1045
+ Added@markuplint/ml-ast@2.0.0-dev.20211115.1(transitive)
+ Added@markuplint/types@1.0.0-dev.20211213.0(transitive)
+ Addedbcp-47@1.0.8(transitive)
+ Addedcss-tree@1.1.3(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addedis-alphabetical@1.0.4(transitive)
+ Addedis-alphanumerical@1.0.4(transitive)
+ Addedis-decimal@1.0.4(transitive)
+ Addedleven@3.1.0(transitive)
+ Addedmdn-data@2.0.14(transitive)
+ Addedms@2.1.3(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedwhatwg-mimetype@2.3.0(transitive)
- Removed@markuplint/ml-ast@2.0.1(transitive)