mirror of
https://github.com/cachix/install-nix-action.git
synced 2025-05-15 04:07:13 +00:00
v6
This commit is contained in:
parent
cd5893b2c6
commit
70742d22d9
6774 changed files with 1602535 additions and 1 deletions
156
node_modules/parse5/lib/common/doctype.js
generated
vendored
Normal file
156
node_modules/parse5/lib/common/doctype.js
generated
vendored
Normal file
|
@ -0,0 +1,156 @@
|
|||
'use strict';
|
||||
|
||||
var DOCUMENT_MODE = require('./html').DOCUMENT_MODE;
|
||||
|
||||
//Const
|
||||
var VALID_DOCTYPE_NAME = 'html',
|
||||
QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd',
|
||||
QUIRKS_MODE_PUBLIC_ID_PREFIXES = [
|
||||
'+//silmaril//dtd html pro v0r11 19970101//en',
|
||||
'-//advasoft ltd//dtd html 3.0 aswedit + extensions//en',
|
||||
'-//as//dtd html 3.0 aswedit + extensions//en',
|
||||
'-//ietf//dtd html 2.0 level 1//en',
|
||||
'-//ietf//dtd html 2.0 level 2//en',
|
||||
'-//ietf//dtd html 2.0 strict level 1//en',
|
||||
'-//ietf//dtd html 2.0 strict level 2//en',
|
||||
'-//ietf//dtd html 2.0 strict//en',
|
||||
'-//ietf//dtd html 2.0//en',
|
||||
'-//ietf//dtd html 2.1e//en',
|
||||
'-//ietf//dtd html 3.0//en',
|
||||
'-//ietf//dtd html 3.0//en//',
|
||||
'-//ietf//dtd html 3.2 final//en',
|
||||
'-//ietf//dtd html 3.2//en',
|
||||
'-//ietf//dtd html 3//en',
|
||||
'-//ietf//dtd html level 0//en',
|
||||
'-//ietf//dtd html level 0//en//2.0',
|
||||
'-//ietf//dtd html level 1//en',
|
||||
'-//ietf//dtd html level 1//en//2.0',
|
||||
'-//ietf//dtd html level 2//en',
|
||||
'-//ietf//dtd html level 2//en//2.0',
|
||||
'-//ietf//dtd html level 3//en',
|
||||
'-//ietf//dtd html level 3//en//3.0',
|
||||
'-//ietf//dtd html strict level 0//en',
|
||||
'-//ietf//dtd html strict level 0//en//2.0',
|
||||
'-//ietf//dtd html strict level 1//en',
|
||||
'-//ietf//dtd html strict level 1//en//2.0',
|
||||
'-//ietf//dtd html strict level 2//en',
|
||||
'-//ietf//dtd html strict level 2//en//2.0',
|
||||
'-//ietf//dtd html strict level 3//en',
|
||||
'-//ietf//dtd html strict level 3//en//3.0',
|
||||
'-//ietf//dtd html strict//en',
|
||||
'-//ietf//dtd html strict//en//2.0',
|
||||
'-//ietf//dtd html strict//en//3.0',
|
||||
'-//ietf//dtd html//en',
|
||||
'-//ietf//dtd html//en//2.0',
|
||||
'-//ietf//dtd html//en//3.0',
|
||||
'-//metrius//dtd metrius presentational//en',
|
||||
'-//microsoft//dtd internet explorer 2.0 html strict//en',
|
||||
'-//microsoft//dtd internet explorer 2.0 html//en',
|
||||
'-//microsoft//dtd internet explorer 2.0 tables//en',
|
||||
'-//microsoft//dtd internet explorer 3.0 html strict//en',
|
||||
'-//microsoft//dtd internet explorer 3.0 html//en',
|
||||
'-//microsoft//dtd internet explorer 3.0 tables//en',
|
||||
'-//netscape comm. corp.//dtd html//en',
|
||||
'-//netscape comm. corp.//dtd strict html//en',
|
||||
'-//o\'reilly and associates//dtd html 2.0//en',
|
||||
'-//o\'reilly and associates//dtd html extended 1.0//en',
|
||||
'-//spyglass//dtd html 2.0 extended//en',
|
||||
'-//sq//dtd html 2.0 hotmetal + extensions//en',
|
||||
'-//sun microsystems corp.//dtd hotjava html//en',
|
||||
'-//sun microsystems corp.//dtd hotjava strict html//en',
|
||||
'-//w3c//dtd html 3 1995-03-24//en',
|
||||
'-//w3c//dtd html 3.2 draft//en',
|
||||
'-//w3c//dtd html 3.2 final//en',
|
||||
'-//w3c//dtd html 3.2//en',
|
||||
'-//w3c//dtd html 3.2s draft//en',
|
||||
'-//w3c//dtd html 4.0 frameset//en',
|
||||
'-//w3c//dtd html 4.0 transitional//en',
|
||||
'-//w3c//dtd html experimental 19960712//en',
|
||||
'-//w3c//dtd html experimental 970421//en',
|
||||
'-//w3c//dtd w3 html//en',
|
||||
'-//w3o//dtd w3 html 3.0//en',
|
||||
'-//w3o//dtd w3 html 3.0//en//',
|
||||
'-//webtechs//dtd mozilla html 2.0//en',
|
||||
'-//webtechs//dtd mozilla html//en'
|
||||
],
|
||||
QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = QUIRKS_MODE_PUBLIC_ID_PREFIXES.concat([
|
||||
'-//w3c//dtd html 4.01 frameset//',
|
||||
'-//w3c//dtd html 4.01 transitional//'
|
||||
]),
|
||||
QUIRKS_MODE_PUBLIC_IDS = [
|
||||
'-//w3o//dtd w3 html strict 3.0//en//',
|
||||
'-/w3c/dtd html 4.0 transitional/en',
|
||||
'html'
|
||||
],
|
||||
LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = [
|
||||
'-//W3C//DTD XHTML 1.0 Frameset//',
|
||||
'-//W3C//DTD XHTML 1.0 Transitional//'
|
||||
],
|
||||
LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = LIMITED_QUIRKS_PUBLIC_ID_PREFIXES.concat([
|
||||
'-//W3C//DTD HTML 4.01 Frameset//',
|
||||
'-//W3C//DTD HTML 4.01 Transitional//'
|
||||
]);
|
||||
|
||||
|
||||
//Utils
|
||||
function enquoteDoctypeId(id) {
|
||||
var quote = id.indexOf('"') !== -1 ? '\'' : '"';
|
||||
|
||||
return quote + id + quote;
|
||||
}
|
||||
|
||||
function hasPrefix(publicId, prefixes) {
|
||||
for (var i = 0; i < prefixes.length; i++) {
|
||||
if (publicId.indexOf(prefixes[i]) === 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//API
|
||||
exports.getDocumentMode = function (name, publicId, systemId) {
|
||||
if (name !== VALID_DOCTYPE_NAME)
|
||||
return DOCUMENT_MODE.QUIRKS;
|
||||
|
||||
if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID)
|
||||
return DOCUMENT_MODE.QUIRKS;
|
||||
|
||||
if (publicId !== null) {
|
||||
publicId = publicId.toLowerCase();
|
||||
|
||||
if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1)
|
||||
return DOCUMENT_MODE.QUIRKS;
|
||||
|
||||
var prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES;
|
||||
|
||||
if (hasPrefix(publicId, prefixes))
|
||||
return DOCUMENT_MODE.QUIRKS;
|
||||
|
||||
prefixes = systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES;
|
||||
|
||||
if (hasPrefix(publicId, prefixes))
|
||||
return DOCUMENT_MODE.LIMITED_QUIRKS;
|
||||
}
|
||||
|
||||
return DOCUMENT_MODE.NO_QUIRKS;
|
||||
};
|
||||
|
||||
exports.serializeContent = function (name, publicId, systemId) {
|
||||
var str = '!DOCTYPE ';
|
||||
|
||||
if (name)
|
||||
str += name;
|
||||
|
||||
if (publicId !== null)
|
||||
str += ' PUBLIC ' + enquoteDoctypeId(publicId);
|
||||
|
||||
else if (systemId !== null)
|
||||
str += ' SYSTEM';
|
||||
|
||||
if (systemId !== null)
|
||||
str += ' ' + enquoteDoctypeId(systemId);
|
||||
|
||||
return str;
|
||||
};
|
260
node_modules/parse5/lib/common/foreign_content.js
generated
vendored
Normal file
260
node_modules/parse5/lib/common/foreign_content.js
generated
vendored
Normal file
|
@ -0,0 +1,260 @@
|
|||
'use strict';
|
||||
|
||||
var Tokenizer = require('../tokenizer'),
|
||||
HTML = require('./html');
|
||||
|
||||
//Aliases
|
||||
var $ = HTML.TAG_NAMES,
|
||||
NS = HTML.NAMESPACES,
|
||||
ATTRS = HTML.ATTRS;
|
||||
|
||||
|
||||
//MIME types
|
||||
var MIME_TYPES = {
|
||||
TEXT_HTML: 'text/html',
|
||||
APPLICATION_XML: 'application/xhtml+xml'
|
||||
};
|
||||
|
||||
//Attributes
|
||||
var DEFINITION_URL_ATTR = 'definitionurl',
|
||||
ADJUSTED_DEFINITION_URL_ATTR = 'definitionURL',
|
||||
SVG_ATTRS_ADJUSTMENT_MAP = {
|
||||
'attributename': 'attributeName',
|
||||
'attributetype': 'attributeType',
|
||||
'basefrequency': 'baseFrequency',
|
||||
'baseprofile': 'baseProfile',
|
||||
'calcmode': 'calcMode',
|
||||
'clippathunits': 'clipPathUnits',
|
||||
'diffuseconstant': 'diffuseConstant',
|
||||
'edgemode': 'edgeMode',
|
||||
'filterunits': 'filterUnits',
|
||||
'glyphref': 'glyphRef',
|
||||
'gradienttransform': 'gradientTransform',
|
||||
'gradientunits': 'gradientUnits',
|
||||
'kernelmatrix': 'kernelMatrix',
|
||||
'kernelunitlength': 'kernelUnitLength',
|
||||
'keypoints': 'keyPoints',
|
||||
'keysplines': 'keySplines',
|
||||
'keytimes': 'keyTimes',
|
||||
'lengthadjust': 'lengthAdjust',
|
||||
'limitingconeangle': 'limitingConeAngle',
|
||||
'markerheight': 'markerHeight',
|
||||
'markerunits': 'markerUnits',
|
||||
'markerwidth': 'markerWidth',
|
||||
'maskcontentunits': 'maskContentUnits',
|
||||
'maskunits': 'maskUnits',
|
||||
'numoctaves': 'numOctaves',
|
||||
'pathlength': 'pathLength',
|
||||
'patterncontentunits': 'patternContentUnits',
|
||||
'patterntransform': 'patternTransform',
|
||||
'patternunits': 'patternUnits',
|
||||
'pointsatx': 'pointsAtX',
|
||||
'pointsaty': 'pointsAtY',
|
||||
'pointsatz': 'pointsAtZ',
|
||||
'preservealpha': 'preserveAlpha',
|
||||
'preserveaspectratio': 'preserveAspectRatio',
|
||||
'primitiveunits': 'primitiveUnits',
|
||||
'refx': 'refX',
|
||||
'refy': 'refY',
|
||||
'repeatcount': 'repeatCount',
|
||||
'repeatdur': 'repeatDur',
|
||||
'requiredextensions': 'requiredExtensions',
|
||||
'requiredfeatures': 'requiredFeatures',
|
||||
'specularconstant': 'specularConstant',
|
||||
'specularexponent': 'specularExponent',
|
||||
'spreadmethod': 'spreadMethod',
|
||||
'startoffset': 'startOffset',
|
||||
'stddeviation': 'stdDeviation',
|
||||
'stitchtiles': 'stitchTiles',
|
||||
'surfacescale': 'surfaceScale',
|
||||
'systemlanguage': 'systemLanguage',
|
||||
'tablevalues': 'tableValues',
|
||||
'targetx': 'targetX',
|
||||
'targety': 'targetY',
|
||||
'textlength': 'textLength',
|
||||
'viewbox': 'viewBox',
|
||||
'viewtarget': 'viewTarget',
|
||||
'xchannelselector': 'xChannelSelector',
|
||||
'ychannelselector': 'yChannelSelector',
|
||||
'zoomandpan': 'zoomAndPan'
|
||||
},
|
||||
XML_ATTRS_ADJUSTMENT_MAP = {
|
||||
'xlink:actuate': {prefix: 'xlink', name: 'actuate', namespace: NS.XLINK},
|
||||
'xlink:arcrole': {prefix: 'xlink', name: 'arcrole', namespace: NS.XLINK},
|
||||
'xlink:href': {prefix: 'xlink', name: 'href', namespace: NS.XLINK},
|
||||
'xlink:role': {prefix: 'xlink', name: 'role', namespace: NS.XLINK},
|
||||
'xlink:show': {prefix: 'xlink', name: 'show', namespace: NS.XLINK},
|
||||
'xlink:title': {prefix: 'xlink', name: 'title', namespace: NS.XLINK},
|
||||
'xlink:type': {prefix: 'xlink', name: 'type', namespace: NS.XLINK},
|
||||
'xml:base': {prefix: 'xml', name: 'base', namespace: NS.XML},
|
||||
'xml:lang': {prefix: 'xml', name: 'lang', namespace: NS.XML},
|
||||
'xml:space': {prefix: 'xml', name: 'space', namespace: NS.XML},
|
||||
'xmlns': {prefix: '', name: 'xmlns', namespace: NS.XMLNS},
|
||||
'xmlns:xlink': {prefix: 'xmlns', name: 'xlink', namespace: NS.XMLNS}
|
||||
|
||||
};
|
||||
|
||||
//SVG tag names adjustment map
|
||||
var SVG_TAG_NAMES_ADJUSTMENT_MAP = exports.SVG_TAG_NAMES_ADJUSTMENT_MAP = {
|
||||
'altglyph': 'altGlyph',
|
||||
'altglyphdef': 'altGlyphDef',
|
||||
'altglyphitem': 'altGlyphItem',
|
||||
'animatecolor': 'animateColor',
|
||||
'animatemotion': 'animateMotion',
|
||||
'animatetransform': 'animateTransform',
|
||||
'clippath': 'clipPath',
|
||||
'feblend': 'feBlend',
|
||||
'fecolormatrix': 'feColorMatrix',
|
||||
'fecomponenttransfer': 'feComponentTransfer',
|
||||
'fecomposite': 'feComposite',
|
||||
'feconvolvematrix': 'feConvolveMatrix',
|
||||
'fediffuselighting': 'feDiffuseLighting',
|
||||
'fedisplacementmap': 'feDisplacementMap',
|
||||
'fedistantlight': 'feDistantLight',
|
||||
'feflood': 'feFlood',
|
||||
'fefunca': 'feFuncA',
|
||||
'fefuncb': 'feFuncB',
|
||||
'fefuncg': 'feFuncG',
|
||||
'fefuncr': 'feFuncR',
|
||||
'fegaussianblur': 'feGaussianBlur',
|
||||
'feimage': 'feImage',
|
||||
'femerge': 'feMerge',
|
||||
'femergenode': 'feMergeNode',
|
||||
'femorphology': 'feMorphology',
|
||||
'feoffset': 'feOffset',
|
||||
'fepointlight': 'fePointLight',
|
||||
'fespecularlighting': 'feSpecularLighting',
|
||||
'fespotlight': 'feSpotLight',
|
||||
'fetile': 'feTile',
|
||||
'feturbulence': 'feTurbulence',
|
||||
'foreignobject': 'foreignObject',
|
||||
'glyphref': 'glyphRef',
|
||||
'lineargradient': 'linearGradient',
|
||||
'radialgradient': 'radialGradient',
|
||||
'textpath': 'textPath'
|
||||
};
|
||||
|
||||
//Tags that causes exit from foreign content
|
||||
var EXITS_FOREIGN_CONTENT = Object.create(null);
|
||||
|
||||
EXITS_FOREIGN_CONTENT[$.B] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.BIG] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.BLOCKQUOTE] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.BODY] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.BR] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.CENTER] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.CODE] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.DD] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.DIV] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.DL] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.DT] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.EM] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.EMBED] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.H1] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.H2] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.H3] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.H4] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.H5] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.H6] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.HEAD] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.HR] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.I] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.IMG] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.LI] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.LISTING] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.MENU] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.META] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.NOBR] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.OL] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.P] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.PRE] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.RUBY] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.S] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.SMALL] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.SPAN] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.STRONG] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.STRIKE] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.SUB] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.SUP] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.TABLE] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.TT] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.U] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.UL] = true;
|
||||
EXITS_FOREIGN_CONTENT[$.VAR] = true;
|
||||
|
||||
//Check exit from foreign content
|
||||
exports.causesExit = function (startTagToken) {
|
||||
var tn = startTagToken.tagName;
|
||||
var isFontWithAttrs = tn === $.FONT && (Tokenizer.getTokenAttr(startTagToken, ATTRS.COLOR) !== null ||
|
||||
Tokenizer.getTokenAttr(startTagToken, ATTRS.SIZE) !== null ||
|
||||
Tokenizer.getTokenAttr(startTagToken, ATTRS.FACE) !== null);
|
||||
|
||||
return isFontWithAttrs ? true : EXITS_FOREIGN_CONTENT[tn];
|
||||
};
|
||||
|
||||
//Token adjustments
|
||||
exports.adjustTokenMathMLAttrs = function (token) {
|
||||
for (var i = 0; i < token.attrs.length; i++) {
|
||||
if (token.attrs[i].name === DEFINITION_URL_ATTR) {
|
||||
token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.adjustTokenSVGAttrs = function (token) {
|
||||
for (var i = 0; i < token.attrs.length; i++) {
|
||||
var adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name];
|
||||
|
||||
if (adjustedAttrName)
|
||||
token.attrs[i].name = adjustedAttrName;
|
||||
}
|
||||
};
|
||||
|
||||
exports.adjustTokenXMLAttrs = function (token) {
|
||||
for (var i = 0; i < token.attrs.length; i++) {
|
||||
var adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name];
|
||||
|
||||
if (adjustedAttrEntry) {
|
||||
token.attrs[i].prefix = adjustedAttrEntry.prefix;
|
||||
token.attrs[i].name = adjustedAttrEntry.name;
|
||||
token.attrs[i].namespace = adjustedAttrEntry.namespace;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.adjustTokenSVGTagName = function (token) {
|
||||
var adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP[token.tagName];
|
||||
|
||||
if (adjustedTagName)
|
||||
token.tagName = adjustedTagName;
|
||||
};
|
||||
|
||||
//Integration points
|
||||
function isMathMLTextIntegrationPoint(tn, ns) {
|
||||
return ns === NS.MATHML && (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS || tn === $.MTEXT);
|
||||
}
|
||||
|
||||
function isHtmlIntegrationPoint(tn, ns, attrs) {
|
||||
if (ns === NS.MATHML && tn === $.ANNOTATION_XML) {
|
||||
for (var i = 0; i < attrs.length; i++) {
|
||||
if (attrs[i].name === ATTRS.ENCODING) {
|
||||
var value = attrs[i].value.toLowerCase();
|
||||
|
||||
return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ns === NS.SVG && (tn === $.FOREIGN_OBJECT || tn === $.DESC || tn === $.TITLE);
|
||||
}
|
||||
|
||||
exports.isIntegrationPoint = function (tn, ns, attrs, foreignNS) {
|
||||
if ((!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs))
|
||||
return true;
|
||||
|
||||
if ((!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
};
|
272
node_modules/parse5/lib/common/html.js
generated
vendored
Normal file
272
node_modules/parse5/lib/common/html.js
generated
vendored
Normal file
|
@ -0,0 +1,272 @@
|
|||
'use strict';
|
||||
|
||||
var NS = exports.NAMESPACES = {
|
||||
HTML: 'http://www.w3.org/1999/xhtml',
|
||||
MATHML: 'http://www.w3.org/1998/Math/MathML',
|
||||
SVG: 'http://www.w3.org/2000/svg',
|
||||
XLINK: 'http://www.w3.org/1999/xlink',
|
||||
XML: 'http://www.w3.org/XML/1998/namespace',
|
||||
XMLNS: 'http://www.w3.org/2000/xmlns/'
|
||||
};
|
||||
|
||||
exports.ATTRS = {
|
||||
TYPE: 'type',
|
||||
ACTION: 'action',
|
||||
ENCODING: 'encoding',
|
||||
PROMPT: 'prompt',
|
||||
NAME: 'name',
|
||||
COLOR: 'color',
|
||||
FACE: 'face',
|
||||
SIZE: 'size'
|
||||
};
|
||||
|
||||
exports.DOCUMENT_MODE = {
|
||||
NO_QUIRKS: 'no-quirks',
|
||||
QUIRKS: 'quirks',
|
||||
LIMITED_QUIRKS: 'limited-quirks'
|
||||
};
|
||||
|
||||
var $ = exports.TAG_NAMES = {
|
||||
A: 'a',
|
||||
ADDRESS: 'address',
|
||||
ANNOTATION_XML: 'annotation-xml',
|
||||
APPLET: 'applet',
|
||||
AREA: 'area',
|
||||
ARTICLE: 'article',
|
||||
ASIDE: 'aside',
|
||||
|
||||
B: 'b',
|
||||
BASE: 'base',
|
||||
BASEFONT: 'basefont',
|
||||
BGSOUND: 'bgsound',
|
||||
BIG: 'big',
|
||||
BLOCKQUOTE: 'blockquote',
|
||||
BODY: 'body',
|
||||
BR: 'br',
|
||||
BUTTON: 'button',
|
||||
|
||||
CAPTION: 'caption',
|
||||
CENTER: 'center',
|
||||
CODE: 'code',
|
||||
COL: 'col',
|
||||
COLGROUP: 'colgroup',
|
||||
|
||||
DD: 'dd',
|
||||
DESC: 'desc',
|
||||
DETAILS: 'details',
|
||||
DIALOG: 'dialog',
|
||||
DIR: 'dir',
|
||||
DIV: 'div',
|
||||
DL: 'dl',
|
||||
DT: 'dt',
|
||||
|
||||
EM: 'em',
|
||||
EMBED: 'embed',
|
||||
|
||||
FIELDSET: 'fieldset',
|
||||
FIGCAPTION: 'figcaption',
|
||||
FIGURE: 'figure',
|
||||
FONT: 'font',
|
||||
FOOTER: 'footer',
|
||||
FOREIGN_OBJECT: 'foreignObject',
|
||||
FORM: 'form',
|
||||
FRAME: 'frame',
|
||||
FRAMESET: 'frameset',
|
||||
|
||||
H1: 'h1',
|
||||
H2: 'h2',
|
||||
H3: 'h3',
|
||||
H4: 'h4',
|
||||
H5: 'h5',
|
||||
H6: 'h6',
|
||||
HEAD: 'head',
|
||||
HEADER: 'header',
|
||||
HGROUP: 'hgroup',
|
||||
HR: 'hr',
|
||||
HTML: 'html',
|
||||
|
||||
I: 'i',
|
||||
IMG: 'img',
|
||||
IMAGE: 'image',
|
||||
INPUT: 'input',
|
||||
IFRAME: 'iframe',
|
||||
|
||||
KEYGEN: 'keygen',
|
||||
|
||||
LABEL: 'label',
|
||||
LI: 'li',
|
||||
LINK: 'link',
|
||||
LISTING: 'listing',
|
||||
|
||||
MAIN: 'main',
|
||||
MALIGNMARK: 'malignmark',
|
||||
MARQUEE: 'marquee',
|
||||
MATH: 'math',
|
||||
MENU: 'menu',
|
||||
MENUITEM: 'menuitem',
|
||||
META: 'meta',
|
||||
MGLYPH: 'mglyph',
|
||||
MI: 'mi',
|
||||
MO: 'mo',
|
||||
MN: 'mn',
|
||||
MS: 'ms',
|
||||
MTEXT: 'mtext',
|
||||
|
||||
NAV: 'nav',
|
||||
NOBR: 'nobr',
|
||||
NOFRAMES: 'noframes',
|
||||
NOEMBED: 'noembed',
|
||||
NOSCRIPT: 'noscript',
|
||||
|
||||
OBJECT: 'object',
|
||||
OL: 'ol',
|
||||
OPTGROUP: 'optgroup',
|
||||
OPTION: 'option',
|
||||
|
||||
P: 'p',
|
||||
PARAM: 'param',
|
||||
PLAINTEXT: 'plaintext',
|
||||
PRE: 'pre',
|
||||
|
||||
RB: 'rb',
|
||||
RP: 'rp',
|
||||
RT: 'rt',
|
||||
RTC: 'rtc',
|
||||
RUBY: 'ruby',
|
||||
|
||||
S: 's',
|
||||
SCRIPT: 'script',
|
||||
SECTION: 'section',
|
||||
SELECT: 'select',
|
||||
SOURCE: 'source',
|
||||
SMALL: 'small',
|
||||
SPAN: 'span',
|
||||
STRIKE: 'strike',
|
||||
STRONG: 'strong',
|
||||
STYLE: 'style',
|
||||
SUB: 'sub',
|
||||
SUMMARY: 'summary',
|
||||
SUP: 'sup',
|
||||
|
||||
TABLE: 'table',
|
||||
TBODY: 'tbody',
|
||||
TEMPLATE: 'template',
|
||||
TEXTAREA: 'textarea',
|
||||
TFOOT: 'tfoot',
|
||||
TD: 'td',
|
||||
TH: 'th',
|
||||
THEAD: 'thead',
|
||||
TITLE: 'title',
|
||||
TR: 'tr',
|
||||
TRACK: 'track',
|
||||
TT: 'tt',
|
||||
|
||||
U: 'u',
|
||||
UL: 'ul',
|
||||
|
||||
SVG: 'svg',
|
||||
|
||||
VAR: 'var',
|
||||
|
||||
WBR: 'wbr',
|
||||
|
||||
XMP: 'xmp'
|
||||
};
|
||||
|
||||
var SPECIAL_ELEMENTS = exports.SPECIAL_ELEMENTS = Object.create(null);
|
||||
|
||||
SPECIAL_ELEMENTS[NS.HTML] = Object.create(null);
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.ADDRESS] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.APPLET] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.AREA] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.ARTICLE] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.ASIDE] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.BASE] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.BASEFONT] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.BGSOUND] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.BLOCKQUOTE] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.BODY] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.BR] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.BUTTON] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.CAPTION] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.CENTER] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.COL] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.COLGROUP] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.DD] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.DETAILS] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.DIR] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.DIV] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.DL] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.DT] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.EMBED] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.FIELDSET] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.FIGCAPTION] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.FIGURE] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.FOOTER] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.FORM] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.FRAME] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.FRAMESET] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.H1] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.H2] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.H3] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.H4] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.H5] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.H6] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.HEAD] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.HEADER] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.HGROUP] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.HR] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.HTML] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.IFRAME] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.IMG] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.INPUT] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.LI] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.LINK] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.LISTING] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.MAIN] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.MARQUEE] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.MENU] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.META] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.NAV] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.NOEMBED] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.NOFRAMES] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.NOSCRIPT] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.OBJECT] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.OL] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.P] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.PARAM] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.PLAINTEXT] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.PRE] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.SCRIPT] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.SECTION] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.SELECT] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.SOURCE] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.STYLE] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.SUMMARY] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.TABLE] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.TBODY] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.TD] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.TEMPLATE] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.TEXTAREA] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.TFOOT] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.TH] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.THEAD] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.TITLE] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.TR] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.TRACK] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.UL] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.WBR] = true;
|
||||
SPECIAL_ELEMENTS[NS.HTML][$.XMP] = true;
|
||||
|
||||
SPECIAL_ELEMENTS[NS.MATHML] = Object.create(null);
|
||||
SPECIAL_ELEMENTS[NS.MATHML][$.MI] = true;
|
||||
SPECIAL_ELEMENTS[NS.MATHML][$.MO] = true;
|
||||
SPECIAL_ELEMENTS[NS.MATHML][$.MN] = true;
|
||||
SPECIAL_ELEMENTS[NS.MATHML][$.MS] = true;
|
||||
SPECIAL_ELEMENTS[NS.MATHML][$.MTEXT] = true;
|
||||
SPECIAL_ELEMENTS[NS.MATHML][$.ANNOTATION_XML] = true;
|
||||
|
||||
SPECIAL_ELEMENTS[NS.SVG] = Object.create(null);
|
||||
SPECIAL_ELEMENTS[NS.SVG][$.TITLE] = true;
|
||||
SPECIAL_ELEMENTS[NS.SVG][$.FOREIGN_OBJECT] = true;
|
||||
SPECIAL_ELEMENTS[NS.SVG][$.DESC] = true;
|
47
node_modules/parse5/lib/common/unicode.js
generated
vendored
Normal file
47
node_modules/parse5/lib/common/unicode.js
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
'use strict';
|
||||
|
||||
exports.REPLACEMENT_CHARACTER = '\uFFFD';
|
||||
|
||||
exports.CODE_POINTS = {
|
||||
EOF: -1,
|
||||
NULL: 0x00,
|
||||
TABULATION: 0x09,
|
||||
CARRIAGE_RETURN: 0x0D,
|
||||
LINE_FEED: 0x0A,
|
||||
FORM_FEED: 0x0C,
|
||||
SPACE: 0x20,
|
||||
EXCLAMATION_MARK: 0x21,
|
||||
QUOTATION_MARK: 0x22,
|
||||
NUMBER_SIGN: 0x23,
|
||||
AMPERSAND: 0x26,
|
||||
APOSTROPHE: 0x27,
|
||||
HYPHEN_MINUS: 0x2D,
|
||||
SOLIDUS: 0x2F,
|
||||
DIGIT_0: 0x30,
|
||||
DIGIT_9: 0x39,
|
||||
SEMICOLON: 0x3B,
|
||||
LESS_THAN_SIGN: 0x3C,
|
||||
EQUALS_SIGN: 0x3D,
|
||||
GREATER_THAN_SIGN: 0x3E,
|
||||
QUESTION_MARK: 0x3F,
|
||||
LATIN_CAPITAL_A: 0x41,
|
||||
LATIN_CAPITAL_F: 0x46,
|
||||
LATIN_CAPITAL_X: 0x58,
|
||||
LATIN_CAPITAL_Z: 0x5A,
|
||||
GRAVE_ACCENT: 0x60,
|
||||
LATIN_SMALL_A: 0x61,
|
||||
LATIN_SMALL_F: 0x66,
|
||||
LATIN_SMALL_X: 0x78,
|
||||
LATIN_SMALL_Z: 0x7A,
|
||||
REPLACEMENT_CHARACTER: 0xFFFD
|
||||
};
|
||||
|
||||
exports.CODE_POINT_SEQUENCES = {
|
||||
DASH_DASH_STRING: [0x2D, 0x2D], //--
|
||||
DOCTYPE_STRING: [0x44, 0x4F, 0x43, 0x54, 0x59, 0x50, 0x45], //DOCTYPE
|
||||
CDATA_START_STRING: [0x5B, 0x43, 0x44, 0x41, 0x54, 0x41, 0x5B], //[CDATA[
|
||||
CDATA_END_STRING: [0x5D, 0x5D, 0x3E], //]]>
|
||||
SCRIPT_STRING: [0x73, 0x63, 0x72, 0x69, 0x70, 0x74], //script
|
||||
PUBLIC_STRING: [0x50, 0x55, 0x42, 0x4C, 0x49, 0x43], //PUBLIC
|
||||
SYSTEM_STRING: [0x53, 0x59, 0x53, 0x54, 0x45, 0x4D] //SYSTEM
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue