Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@markuplint/parser-utils

Package Overview
Dependencies
Maintainers
1
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@markuplint/parser-utils - npm Package Compare versions

Comparing version 2.0.0-dev.20211115.0 to 2.0.0-dev.20211213.0

1

lib/const.d.ts
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;

7

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc