sanitize-html 1.27.4 → 1.27.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/README.md +13 -5
- package/dist/sanitize-html-es2015.js +479 -567
- package/dist/sanitize-html.js +71 -65
- package/dist/sanitize-html.min.js +1 -1
- package/package.json +3 -3
|
@@ -1936,297 +1936,320 @@ function numberIsNaN (obj) {
|
|
|
1936
1936
|
|
|
1937
1937
|
}).call(this,require("buffer").Buffer)
|
|
1938
1938
|
},{"base64-js":1,"buffer":3,"ieee754":32}],4:[function(require,module,exports){
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
"
|
|
1944
|
-
"
|
|
1945
|
-
"
|
|
1946
|
-
"
|
|
1947
|
-
"
|
|
1948
|
-
"
|
|
1949
|
-
"
|
|
1950
|
-
"
|
|
1951
|
-
"
|
|
1952
|
-
"
|
|
1953
|
-
"
|
|
1954
|
-
"
|
|
1955
|
-
"
|
|
1956
|
-
"
|
|
1957
|
-
"
|
|
1958
|
-
"
|
|
1959
|
-
"
|
|
1960
|
-
"
|
|
1961
|
-
"
|
|
1962
|
-
"
|
|
1963
|
-
"
|
|
1964
|
-
"
|
|
1965
|
-
"
|
|
1966
|
-
"
|
|
1967
|
-
"
|
|
1968
|
-
"
|
|
1969
|
-
"
|
|
1970
|
-
"
|
|
1971
|
-
"
|
|
1972
|
-
"
|
|
1973
|
-
"
|
|
1974
|
-
"
|
|
1975
|
-
"
|
|
1976
|
-
"
|
|
1977
|
-
"
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
"
|
|
1983
|
-
"
|
|
1984
|
-
"
|
|
1985
|
-
"
|
|
1986
|
-
"
|
|
1987
|
-
"
|
|
1988
|
-
"
|
|
1989
|
-
"
|
|
1990
|
-
"
|
|
1991
|
-
"
|
|
1992
|
-
"
|
|
1993
|
-
"
|
|
1994
|
-
"
|
|
1995
|
-
"
|
|
1996
|
-
"
|
|
1997
|
-
"
|
|
1998
|
-
"
|
|
1999
|
-
"
|
|
2000
|
-
"
|
|
2001
|
-
"
|
|
2002
|
-
"
|
|
2003
|
-
"
|
|
2004
|
-
"
|
|
2005
|
-
"
|
|
2006
|
-
"
|
|
2007
|
-
"
|
|
2008
|
-
"
|
|
2009
|
-
"
|
|
2010
|
-
"
|
|
2011
|
-
"
|
|
2012
|
-
"
|
|
2013
|
-
"
|
|
2014
|
-
"
|
|
2015
|
-
"
|
|
2016
|
-
"
|
|
2017
|
-
"
|
|
2018
|
-
"
|
|
2019
|
-
"
|
|
2020
|
-
"
|
|
2021
|
-
"
|
|
2022
|
-
"
|
|
2023
|
-
"
|
|
2024
|
-
"
|
|
2025
|
-
"
|
|
2026
|
-
"
|
|
2027
|
-
"
|
|
2028
|
-
"
|
|
2029
|
-
"
|
|
2030
|
-
"
|
|
2031
|
-
"
|
|
2032
|
-
"
|
|
2033
|
-
"
|
|
2034
|
-
"
|
|
2035
|
-
"
|
|
2036
|
-
"
|
|
2037
|
-
"
|
|
2038
|
-
"
|
|
2039
|
-
|
|
2040
|
-
|
|
1939
|
+
"use strict";
|
|
1940
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1941
|
+
exports.attributeNames = exports.elementNames = void 0;
|
|
1942
|
+
exports.elementNames = new Map([
|
|
1943
|
+
["altglyph", "altGlyph"],
|
|
1944
|
+
["altglyphdef", "altGlyphDef"],
|
|
1945
|
+
["altglyphitem", "altGlyphItem"],
|
|
1946
|
+
["animatecolor", "animateColor"],
|
|
1947
|
+
["animatemotion", "animateMotion"],
|
|
1948
|
+
["animatetransform", "animateTransform"],
|
|
1949
|
+
["clippath", "clipPath"],
|
|
1950
|
+
["feblend", "feBlend"],
|
|
1951
|
+
["fecolormatrix", "feColorMatrix"],
|
|
1952
|
+
["fecomponenttransfer", "feComponentTransfer"],
|
|
1953
|
+
["fecomposite", "feComposite"],
|
|
1954
|
+
["feconvolvematrix", "feConvolveMatrix"],
|
|
1955
|
+
["fediffuselighting", "feDiffuseLighting"],
|
|
1956
|
+
["fedisplacementmap", "feDisplacementMap"],
|
|
1957
|
+
["fedistantlight", "feDistantLight"],
|
|
1958
|
+
["fedropshadow", "feDropShadow"],
|
|
1959
|
+
["feflood", "feFlood"],
|
|
1960
|
+
["fefunca", "feFuncA"],
|
|
1961
|
+
["fefuncb", "feFuncB"],
|
|
1962
|
+
["fefuncg", "feFuncG"],
|
|
1963
|
+
["fefuncr", "feFuncR"],
|
|
1964
|
+
["fegaussianblur", "feGaussianBlur"],
|
|
1965
|
+
["feimage", "feImage"],
|
|
1966
|
+
["femerge", "feMerge"],
|
|
1967
|
+
["femergenode", "feMergeNode"],
|
|
1968
|
+
["femorphology", "feMorphology"],
|
|
1969
|
+
["feoffset", "feOffset"],
|
|
1970
|
+
["fepointlight", "fePointLight"],
|
|
1971
|
+
["fespecularlighting", "feSpecularLighting"],
|
|
1972
|
+
["fespotlight", "feSpotLight"],
|
|
1973
|
+
["fetile", "feTile"],
|
|
1974
|
+
["feturbulence", "feTurbulence"],
|
|
1975
|
+
["foreignobject", "foreignObject"],
|
|
1976
|
+
["glyphref", "glyphRef"],
|
|
1977
|
+
["lineargradient", "linearGradient"],
|
|
1978
|
+
["radialgradient", "radialGradient"],
|
|
1979
|
+
["textpath", "textPath"],
|
|
1980
|
+
]);
|
|
1981
|
+
exports.attributeNames = new Map([
|
|
1982
|
+
["definitionurl", "definitionURL"],
|
|
1983
|
+
["attributename", "attributeName"],
|
|
1984
|
+
["attributetype", "attributeType"],
|
|
1985
|
+
["basefrequency", "baseFrequency"],
|
|
1986
|
+
["baseprofile", "baseProfile"],
|
|
1987
|
+
["calcmode", "calcMode"],
|
|
1988
|
+
["clippathunits", "clipPathUnits"],
|
|
1989
|
+
["diffuseconstant", "diffuseConstant"],
|
|
1990
|
+
["edgemode", "edgeMode"],
|
|
1991
|
+
["filterunits", "filterUnits"],
|
|
1992
|
+
["glyphref", "glyphRef"],
|
|
1993
|
+
["gradienttransform", "gradientTransform"],
|
|
1994
|
+
["gradientunits", "gradientUnits"],
|
|
1995
|
+
["kernelmatrix", "kernelMatrix"],
|
|
1996
|
+
["kernelunitlength", "kernelUnitLength"],
|
|
1997
|
+
["keypoints", "keyPoints"],
|
|
1998
|
+
["keysplines", "keySplines"],
|
|
1999
|
+
["keytimes", "keyTimes"],
|
|
2000
|
+
["lengthadjust", "lengthAdjust"],
|
|
2001
|
+
["limitingconeangle", "limitingConeAngle"],
|
|
2002
|
+
["markerheight", "markerHeight"],
|
|
2003
|
+
["markerunits", "markerUnits"],
|
|
2004
|
+
["markerwidth", "markerWidth"],
|
|
2005
|
+
["maskcontentunits", "maskContentUnits"],
|
|
2006
|
+
["maskunits", "maskUnits"],
|
|
2007
|
+
["numoctaves", "numOctaves"],
|
|
2008
|
+
["pathlength", "pathLength"],
|
|
2009
|
+
["patterncontentunits", "patternContentUnits"],
|
|
2010
|
+
["patterntransform", "patternTransform"],
|
|
2011
|
+
["patternunits", "patternUnits"],
|
|
2012
|
+
["pointsatx", "pointsAtX"],
|
|
2013
|
+
["pointsaty", "pointsAtY"],
|
|
2014
|
+
["pointsatz", "pointsAtZ"],
|
|
2015
|
+
["preservealpha", "preserveAlpha"],
|
|
2016
|
+
["preserveaspectratio", "preserveAspectRatio"],
|
|
2017
|
+
["primitiveunits", "primitiveUnits"],
|
|
2018
|
+
["refx", "refX"],
|
|
2019
|
+
["refy", "refY"],
|
|
2020
|
+
["repeatcount", "repeatCount"],
|
|
2021
|
+
["repeatdur", "repeatDur"],
|
|
2022
|
+
["requiredextensions", "requiredExtensions"],
|
|
2023
|
+
["requiredfeatures", "requiredFeatures"],
|
|
2024
|
+
["specularconstant", "specularConstant"],
|
|
2025
|
+
["specularexponent", "specularExponent"],
|
|
2026
|
+
["spreadmethod", "spreadMethod"],
|
|
2027
|
+
["startoffset", "startOffset"],
|
|
2028
|
+
["stddeviation", "stdDeviation"],
|
|
2029
|
+
["stitchtiles", "stitchTiles"],
|
|
2030
|
+
["surfacescale", "surfaceScale"],
|
|
2031
|
+
["systemlanguage", "systemLanguage"],
|
|
2032
|
+
["tablevalues", "tableValues"],
|
|
2033
|
+
["targetx", "targetX"],
|
|
2034
|
+
["targety", "targetY"],
|
|
2035
|
+
["textlength", "textLength"],
|
|
2036
|
+
["viewbox", "viewBox"],
|
|
2037
|
+
["viewtarget", "viewTarget"],
|
|
2038
|
+
["xchannelselector", "xChannelSelector"],
|
|
2039
|
+
["ychannelselector", "yChannelSelector"],
|
|
2040
|
+
["zoomandpan", "zoomAndPan"],
|
|
2041
|
+
]);
|
|
2041
2042
|
|
|
2042
2043
|
},{}],5:[function(require,module,exports){
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
var
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
foreignNames.elementNames.__proto__ = null; /* use as a simple dictionary */
|
|
2055
|
-
foreignNames.attributeNames.__proto__ = null;
|
|
2056
|
-
|
|
2057
|
-
var unencodedElements = {
|
|
2058
|
-
__proto__: null,
|
|
2059
|
-
style: true,
|
|
2060
|
-
script: true,
|
|
2061
|
-
xmp: true,
|
|
2062
|
-
iframe: true,
|
|
2063
|
-
noembed: true,
|
|
2064
|
-
noframes: true,
|
|
2065
|
-
plaintext: true,
|
|
2066
|
-
noscript: true
|
|
2044
|
+
"use strict";
|
|
2045
|
+
var __assign = (this && this.__assign) || function () {
|
|
2046
|
+
__assign = Object.assign || function(t) {
|
|
2047
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2048
|
+
s = arguments[i];
|
|
2049
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
2050
|
+
t[p] = s[p];
|
|
2051
|
+
}
|
|
2052
|
+
return t;
|
|
2053
|
+
};
|
|
2054
|
+
return __assign.apply(this, arguments);
|
|
2067
2055
|
};
|
|
2068
|
-
|
|
2056
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2057
|
+
if (k2 === undefined) k2 = k;
|
|
2058
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
2059
|
+
}) : (function(o, m, k, k2) {
|
|
2060
|
+
if (k2 === undefined) k2 = k;
|
|
2061
|
+
o[k2] = m[k];
|
|
2062
|
+
}));
|
|
2063
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
2064
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
2065
|
+
}) : function(o, v) {
|
|
2066
|
+
o["default"] = v;
|
|
2067
|
+
});
|
|
2068
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
2069
|
+
if (mod && mod.__esModule) return mod;
|
|
2070
|
+
var result = {};
|
|
2071
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
2072
|
+
__setModuleDefault(result, mod);
|
|
2073
|
+
return result;
|
|
2074
|
+
};
|
|
2075
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2069
2076
|
/*
|
|
2070
|
-
|
|
2071
|
-
*/
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2077
|
+
* Module dependencies
|
|
2078
|
+
*/
|
|
2079
|
+
var ElementType = __importStar(require("domelementtype"));
|
|
2080
|
+
var entities_1 = require("entities");
|
|
2081
|
+
/*
|
|
2082
|
+
* Mixed-case SVG and MathML tags & attributes
|
|
2083
|
+
* recognized by the HTML parser, see
|
|
2084
|
+
* https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
|
2085
|
+
*/
|
|
2086
|
+
var foreignNames_1 = require("./foreignNames");
|
|
2087
|
+
var unencodedElements = new Set([
|
|
2088
|
+
"style",
|
|
2089
|
+
"script",
|
|
2090
|
+
"xmp",
|
|
2091
|
+
"iframe",
|
|
2092
|
+
"noembed",
|
|
2093
|
+
"noframes",
|
|
2094
|
+
"plaintext",
|
|
2095
|
+
"noscript",
|
|
2096
|
+
]);
|
|
2097
|
+
/**
|
|
2098
|
+
* Format attributes
|
|
2099
|
+
*/
|
|
2100
|
+
function formatAttributes(attributes, opts) {
|
|
2101
|
+
if (!attributes)
|
|
2102
|
+
return;
|
|
2103
|
+
return Object.keys(attributes)
|
|
2104
|
+
.map(function (key) {
|
|
2105
|
+
var _a, _b;
|
|
2106
|
+
var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : "";
|
|
2107
|
+
if (opts.xmlMode === "foreign") {
|
|
2108
|
+
/* Fix up mixed-case attribute names */
|
|
2109
|
+
key = (_b = foreignNames_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;
|
|
2110
|
+
}
|
|
2111
|
+
if (!opts.emptyAttrs && !opts.xmlMode && value === "") {
|
|
2112
|
+
return key;
|
|
2113
|
+
}
|
|
2114
|
+
return key + "=\"" + (opts.decodeEntities ? entities_1.encodeXML(value) : value.replace(/"/g, """)) + "\"";
|
|
2115
|
+
})
|
|
2116
|
+
.join(" ");
|
|
2117
|
+
}
|
|
2118
|
+
/**
|
|
2119
|
+
* Self-enclosing tags
|
|
2120
|
+
*/
|
|
2121
|
+
var singleTag = new Set([
|
|
2122
|
+
"area",
|
|
2123
|
+
"base",
|
|
2124
|
+
"basefont",
|
|
2125
|
+
"br",
|
|
2126
|
+
"col",
|
|
2127
|
+
"command",
|
|
2128
|
+
"embed",
|
|
2129
|
+
"frame",
|
|
2130
|
+
"hr",
|
|
2131
|
+
"img",
|
|
2132
|
+
"input",
|
|
2133
|
+
"isindex",
|
|
2134
|
+
"keygen",
|
|
2135
|
+
"link",
|
|
2136
|
+
"meta",
|
|
2137
|
+
"param",
|
|
2138
|
+
"source",
|
|
2139
|
+
"track",
|
|
2140
|
+
"wbr",
|
|
2141
|
+
]);
|
|
2142
|
+
/**
|
|
2143
|
+
* Renders a DOM node or an array of DOM nodes to a string.
|
|
2144
|
+
*
|
|
2145
|
+
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
|
2146
|
+
*
|
|
2147
|
+
* @param node Node to be rendered.
|
|
2148
|
+
* @param options Changes serialization behavior
|
|
2149
|
+
*/
|
|
2150
|
+
function render(node, options) {
|
|
2151
|
+
if (options === void 0) { options = {}; }
|
|
2152
|
+
// TODO: This is a bit hacky.
|
|
2153
|
+
var nodes = Array.isArray(node) || node.cheerio ? node : [node];
|
|
2154
|
+
var output = "";
|
|
2155
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
2156
|
+
output += renderNode(nodes[i], options);
|
|
2088
2157
|
}
|
|
2089
|
-
output
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2158
|
+
return output;
|
|
2159
|
+
}
|
|
2160
|
+
exports.default = render;
|
|
2161
|
+
function renderNode(node, options) {
|
|
2162
|
+
switch (node.type) {
|
|
2163
|
+
case "root":
|
|
2164
|
+
return render(node.children, options);
|
|
2165
|
+
case ElementType.Directive:
|
|
2166
|
+
return renderDirective(node);
|
|
2167
|
+
case ElementType.Comment:
|
|
2168
|
+
return renderComment(node);
|
|
2169
|
+
case ElementType.CDATA:
|
|
2170
|
+
return renderCdata(node);
|
|
2171
|
+
default:
|
|
2172
|
+
return ElementType.isTag(node)
|
|
2173
|
+
? renderTag(node, options)
|
|
2174
|
+
: renderText(node, options);
|
|
2097
2175
|
}
|
|
2098
|
-
}
|
|
2099
|
-
|
|
2100
|
-
return output;
|
|
2101
2176
|
}
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
embed: true,
|
|
2115
|
-
frame: true,
|
|
2116
|
-
hr: true,
|
|
2117
|
-
img: true,
|
|
2118
|
-
input: true,
|
|
2119
|
-
isindex: true,
|
|
2120
|
-
keygen: true,
|
|
2121
|
-
link: true,
|
|
2122
|
-
meta: true,
|
|
2123
|
-
param: true,
|
|
2124
|
-
source: true,
|
|
2125
|
-
track: true,
|
|
2126
|
-
wbr: true
|
|
2127
|
-
};
|
|
2128
|
-
|
|
2129
|
-
var render = (module.exports = function(dom, opts) {
|
|
2130
|
-
if (!Array.isArray(dom) && !dom.cheerio) dom = [dom];
|
|
2131
|
-
opts = opts || {};
|
|
2132
|
-
|
|
2133
|
-
var output = '';
|
|
2134
|
-
|
|
2135
|
-
for (var i = 0; i < dom.length; i++) {
|
|
2136
|
-
var elem = dom[i];
|
|
2137
|
-
|
|
2138
|
-
if (elem.type === 'root') output += render(elem.children, opts);
|
|
2139
|
-
else if (ElementType.isTag(elem)) output += renderTag(elem, opts);
|
|
2140
|
-
else if (elem.type === ElementType.Directive)
|
|
2141
|
-
output += renderDirective(elem);
|
|
2142
|
-
else if (elem.type === ElementType.Comment) output += renderComment(elem);
|
|
2143
|
-
else if (elem.type === ElementType.CDATA) output += renderCdata(elem);
|
|
2144
|
-
else output += renderText(elem, opts);
|
|
2145
|
-
}
|
|
2146
|
-
|
|
2147
|
-
return output;
|
|
2148
|
-
});
|
|
2149
|
-
|
|
2150
|
-
var foreignModeIntegrationPoints = [
|
|
2151
|
-
'mi',
|
|
2152
|
-
'mo',
|
|
2153
|
-
'mn',
|
|
2154
|
-
'ms',
|
|
2155
|
-
'mtext',
|
|
2156
|
-
'annotation-xml',
|
|
2157
|
-
'foreignObject',
|
|
2158
|
-
'desc',
|
|
2159
|
-
'title'
|
|
2160
|
-
];
|
|
2161
|
-
|
|
2177
|
+
var foreignModeIntegrationPoints = new Set([
|
|
2178
|
+
"mi",
|
|
2179
|
+
"mo",
|
|
2180
|
+
"mn",
|
|
2181
|
+
"ms",
|
|
2182
|
+
"mtext",
|
|
2183
|
+
"annotation-xml",
|
|
2184
|
+
"foreignObject",
|
|
2185
|
+
"desc",
|
|
2186
|
+
"title",
|
|
2187
|
+
]);
|
|
2188
|
+
var foreignElements = new Set(["svg", "math"]);
|
|
2162
2189
|
function renderTag(elem, opts) {
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
}
|
|
2174
|
-
if (!opts.xmlMode && ['svg', 'math'].indexOf(elem.name) >= 0) {
|
|
2175
|
-
opts = Object.assign({}, opts, { xmlMode: 'foreign' });
|
|
2176
|
-
}
|
|
2177
|
-
|
|
2178
|
-
var tag = '<' + elem.name;
|
|
2179
|
-
var attribs = formatAttrs(elem.attribs, opts);
|
|
2180
|
-
|
|
2181
|
-
if (attribs) {
|
|
2182
|
-
tag += ' ' + attribs;
|
|
2183
|
-
}
|
|
2184
|
-
|
|
2185
|
-
if (opts.xmlMode && (!elem.children || elem.children.length === 0)) {
|
|
2186
|
-
tag += '/>';
|
|
2187
|
-
} else {
|
|
2188
|
-
tag += '>';
|
|
2189
|
-
if (elem.children) {
|
|
2190
|
-
tag += render(elem.children, opts);
|
|
2190
|
+
var _a;
|
|
2191
|
+
// Handle SVG / MathML in HTML
|
|
2192
|
+
if (opts.xmlMode === "foreign") {
|
|
2193
|
+
/* Fix up mixed-case element names */
|
|
2194
|
+
elem.name = (_a = foreignNames_1.elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;
|
|
2195
|
+
/* Exit foreign mode at integration points */
|
|
2196
|
+
if (elem.parent &&
|
|
2197
|
+
foreignModeIntegrationPoints.has(elem.parent.name)) {
|
|
2198
|
+
opts = __assign(__assign({}, opts), { xmlMode: false });
|
|
2199
|
+
}
|
|
2191
2200
|
}
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
tag += '</' + elem.name + '>';
|
|
2201
|
+
if (!opts.xmlMode && foreignElements.has(elem.name)) {
|
|
2202
|
+
opts = __assign(__assign({}, opts), { xmlMode: "foreign" });
|
|
2195
2203
|
}
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2204
|
+
var tag = "<" + elem.name;
|
|
2205
|
+
var attribs = formatAttributes(elem.attribs, opts);
|
|
2206
|
+
if (attribs) {
|
|
2207
|
+
tag += " " + attribs;
|
|
2208
|
+
}
|
|
2209
|
+
if (elem.children.length === 0 &&
|
|
2210
|
+
(opts.xmlMode
|
|
2211
|
+
? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
|
|
2212
|
+
opts.selfClosingTags !== false
|
|
2213
|
+
: // User explicitly asked for self-closing tags, even in HTML mode
|
|
2214
|
+
opts.selfClosingTags && singleTag.has(elem.name))) {
|
|
2215
|
+
if (!opts.xmlMode)
|
|
2216
|
+
tag += " ";
|
|
2217
|
+
tag += "/>";
|
|
2218
|
+
}
|
|
2219
|
+
else {
|
|
2220
|
+
tag += ">";
|
|
2221
|
+
if (elem.children.length > 0) {
|
|
2222
|
+
tag += render(elem.children, opts);
|
|
2223
|
+
}
|
|
2224
|
+
if (opts.xmlMode || !singleTag.has(elem.name)) {
|
|
2225
|
+
tag += "</" + elem.name + ">";
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
return tag;
|
|
2199
2229
|
}
|
|
2200
|
-
|
|
2201
2230
|
function renderDirective(elem) {
|
|
2202
|
-
|
|
2231
|
+
return "<" + elem.data + ">";
|
|
2203
2232
|
}
|
|
2204
|
-
|
|
2205
2233
|
function renderText(elem, opts) {
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
data = entities.encodeXML(data);
|
|
2214
|
-
}
|
|
2215
|
-
|
|
2216
|
-
return data;
|
|
2234
|
+
var data = elem.data || "";
|
|
2235
|
+
// If entities weren't decoded, no need to encode them back
|
|
2236
|
+
if (opts.decodeEntities &&
|
|
2237
|
+
!(elem.parent && unencodedElements.has(elem.parent.name))) {
|
|
2238
|
+
data = entities_1.encodeXML(data);
|
|
2239
|
+
}
|
|
2240
|
+
return data;
|
|
2217
2241
|
}
|
|
2218
|
-
|
|
2219
2242
|
function renderCdata(elem) {
|
|
2220
|
-
|
|
2243
|
+
return "<![CDATA[" + elem.children[0].data + "]]>";
|
|
2221
2244
|
}
|
|
2222
|
-
|
|
2223
2245
|
function renderComment(elem) {
|
|
2224
|
-
|
|
2246
|
+
return "<!--" + elem.data + "-->";
|
|
2225
2247
|
}
|
|
2226
2248
|
|
|
2227
|
-
},{"./foreignNames
|
|
2249
|
+
},{"./foreignNames":4,"domelementtype":6,"entities":20}],6:[function(require,module,exports){
|
|
2228
2250
|
"use strict";
|
|
2229
2251
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2252
|
+
exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.isTag = void 0;
|
|
2230
2253
|
/**
|
|
2231
2254
|
* Tests whether an element is a tag or not.
|
|
2232
2255
|
*
|
|
@@ -2239,13 +2262,21 @@ function isTag(elem) {
|
|
|
2239
2262
|
}
|
|
2240
2263
|
exports.isTag = isTag;
|
|
2241
2264
|
// Exports for backwards compatibility
|
|
2242
|
-
|
|
2243
|
-
exports.
|
|
2244
|
-
|
|
2245
|
-
exports.
|
|
2246
|
-
|
|
2247
|
-
exports.
|
|
2248
|
-
|
|
2265
|
+
/** Type for Text */
|
|
2266
|
+
exports.Text = "text" /* Text */;
|
|
2267
|
+
/** Type for <? ... ?> */
|
|
2268
|
+
exports.Directive = "directive" /* Directive */;
|
|
2269
|
+
/** Type for <!-- ... --> */
|
|
2270
|
+
exports.Comment = "comment" /* Comment */;
|
|
2271
|
+
/** Type for <script> tags */
|
|
2272
|
+
exports.Script = "script" /* Script */;
|
|
2273
|
+
/** Type for <style> tags */
|
|
2274
|
+
exports.Style = "style" /* Style */;
|
|
2275
|
+
/** Type for Any tag */
|
|
2276
|
+
exports.Tag = "tag" /* Tag */;
|
|
2277
|
+
/** Type for <![CDATA[ ... ]]> */
|
|
2278
|
+
exports.CDATA = "cdata" /* CDATA */;
|
|
2279
|
+
/** Type for <!doctype ...> */
|
|
2249
2280
|
exports.Doctype = "doctype" /* Doctype */;
|
|
2250
2281
|
|
|
2251
2282
|
},{}],7:[function(require,module,exports){
|
|
@@ -2618,6 +2649,7 @@ exports.Element = Element;
|
|
|
2618
2649
|
},{}],9:[function(require,module,exports){
|
|
2619
2650
|
"use strict";
|
|
2620
2651
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2652
|
+
exports.uniqueSort = exports.compareDocumentPosition = exports.removeSubsets = void 0;
|
|
2621
2653
|
var tagtypes_1 = require("./tagtypes");
|
|
2622
2654
|
/**
|
|
2623
2655
|
* Given an array of nodes, remove any member that is contained by another.
|
|
@@ -2626,19 +2658,23 @@ var tagtypes_1 = require("./tagtypes");
|
|
|
2626
2658
|
*/
|
|
2627
2659
|
function removeSubsets(nodes) {
|
|
2628
2660
|
var idx = nodes.length;
|
|
2629
|
-
|
|
2630
|
-
|
|
2661
|
+
/*
|
|
2662
|
+
* Check if each node (or one of its ancestors) is already contained in the
|
|
2663
|
+
* array.
|
|
2664
|
+
*/
|
|
2631
2665
|
while (--idx >= 0) {
|
|
2632
2666
|
var node = nodes[idx];
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2667
|
+
/*
|
|
2668
|
+
* Remove the node if it is not unique.
|
|
2669
|
+
* We are going through the array from the end, so we only
|
|
2670
|
+
* have to check nodes that preceed the node under consideration in the array.
|
|
2671
|
+
*/
|
|
2636
2672
|
if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) {
|
|
2637
2673
|
nodes.splice(idx, 1);
|
|
2638
2674
|
continue;
|
|
2639
2675
|
}
|
|
2640
2676
|
for (var ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
|
|
2641
|
-
if (nodes.
|
|
2677
|
+
if (nodes.includes(ancestor)) {
|
|
2642
2678
|
nodes.splice(idx, 1);
|
|
2643
2679
|
break;
|
|
2644
2680
|
}
|
|
@@ -2647,7 +2683,7 @@ function removeSubsets(nodes) {
|
|
|
2647
2683
|
return nodes;
|
|
2648
2684
|
}
|
|
2649
2685
|
exports.removeSubsets = removeSubsets;
|
|
2650
|
-
|
|
2686
|
+
/**
|
|
2651
2687
|
* Compare the position of one node against another node in any other document.
|
|
2652
2688
|
* The return value is a bitmask with the following values:
|
|
2653
2689
|
*
|
|
@@ -2688,8 +2724,9 @@ function compareDocumentPosition(nodeA, nodeB) {
|
|
|
2688
2724
|
bParents.unshift(current);
|
|
2689
2725
|
current = current.parent;
|
|
2690
2726
|
}
|
|
2727
|
+
var maxIdx = Math.min(aParents.length, bParents.length);
|
|
2691
2728
|
var idx = 0;
|
|
2692
|
-
while (aParents[idx] === bParents[idx]) {
|
|
2729
|
+
while (idx < maxIdx && aParents[idx] === bParents[idx]) {
|
|
2693
2730
|
idx++;
|
|
2694
2731
|
}
|
|
2695
2732
|
if (idx === 0) {
|
|
@@ -2705,15 +2742,13 @@ function compareDocumentPosition(nodeA, nodeB) {
|
|
|
2705
2742
|
}
|
|
2706
2743
|
return 4 /* FOLLOWING */;
|
|
2707
2744
|
}
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
return 2 /* PRECEDING */ | 8 /* CONTAINS */;
|
|
2711
|
-
}
|
|
2712
|
-
return 2 /* PRECEDING */;
|
|
2745
|
+
if (sharedParent === nodeA) {
|
|
2746
|
+
return 2 /* PRECEDING */ | 8 /* CONTAINS */;
|
|
2713
2747
|
}
|
|
2748
|
+
return 2 /* PRECEDING */;
|
|
2714
2749
|
}
|
|
2715
2750
|
exports.compareDocumentPosition = compareDocumentPosition;
|
|
2716
|
-
|
|
2751
|
+
/**
|
|
2717
2752
|
* Sort an array of nodes based on their relative position in the document and
|
|
2718
2753
|
* remove any duplicate nodes. If the array contains nodes that do not belong
|
|
2719
2754
|
* to the same document, sort order is unspecified.
|
|
@@ -2739,27 +2774,34 @@ exports.uniqueSort = uniqueSort;
|
|
|
2739
2774
|
|
|
2740
2775
|
},{"./tagtypes":15}],10:[function(require,module,exports){
|
|
2741
2776
|
"use strict";
|
|
2742
|
-
function
|
|
2743
|
-
|
|
2744
|
-
}
|
|
2777
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2778
|
+
if (k2 === undefined) k2 = k;
|
|
2779
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
2780
|
+
}) : (function(o, m, k, k2) {
|
|
2781
|
+
if (k2 === undefined) k2 = k;
|
|
2782
|
+
o[k2] = m[k];
|
|
2783
|
+
}));
|
|
2784
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
2785
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
2786
|
+
};
|
|
2745
2787
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2788
|
+
__exportStar(require("./stringify"), exports);
|
|
2789
|
+
__exportStar(require("./traversal"), exports);
|
|
2790
|
+
__exportStar(require("./manipulation"), exports);
|
|
2791
|
+
__exportStar(require("./querying"), exports);
|
|
2792
|
+
__exportStar(require("./legacy"), exports);
|
|
2793
|
+
__exportStar(require("./helpers"), exports);
|
|
2794
|
+
__exportStar(require("./tagtypes"), exports);
|
|
2753
2795
|
|
|
2754
2796
|
},{"./helpers":9,"./legacy":11,"./manipulation":12,"./querying":13,"./stringify":14,"./tagtypes":15,"./traversal":16}],11:[function(require,module,exports){
|
|
2755
2797
|
"use strict";
|
|
2756
2798
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2799
|
+
exports.getElementsByTagType = exports.getElementsByTagName = exports.getElementById = exports.getElements = exports.testElement = void 0;
|
|
2757
2800
|
var querying_1 = require("./querying");
|
|
2758
2801
|
var tagtypes_1 = require("./tagtypes");
|
|
2759
2802
|
function isTextNode(node) {
|
|
2760
2803
|
return node.type === "text" /* Text */;
|
|
2761
2804
|
}
|
|
2762
|
-
/* eslint-disable @typescript-eslint/camelcase */
|
|
2763
2805
|
var Checks = {
|
|
2764
2806
|
tag_name: function (name) {
|
|
2765
2807
|
if (typeof name === "function") {
|
|
@@ -2768,35 +2810,26 @@ var Checks = {
|
|
|
2768
2810
|
else if (name === "*") {
|
|
2769
2811
|
return tagtypes_1.isTag;
|
|
2770
2812
|
}
|
|
2771
|
-
|
|
2772
|
-
return function (elem) { return tagtypes_1.isTag(elem) && elem.name === name; };
|
|
2773
|
-
}
|
|
2813
|
+
return function (elem) { return tagtypes_1.isTag(elem) && elem.name === name; };
|
|
2774
2814
|
},
|
|
2775
2815
|
tag_type: function (type) {
|
|
2776
2816
|
if (typeof type === "function") {
|
|
2777
2817
|
return function (elem) { return type(elem.type); };
|
|
2778
2818
|
}
|
|
2779
|
-
|
|
2780
|
-
return function (elem) { return elem.type === type; };
|
|
2781
|
-
}
|
|
2819
|
+
return function (elem) { return elem.type === type; };
|
|
2782
2820
|
},
|
|
2783
2821
|
tag_contains: function (data) {
|
|
2784
2822
|
if (typeof data === "function") {
|
|
2785
2823
|
return function (elem) { return isTextNode(elem) && data(elem.data); };
|
|
2786
2824
|
}
|
|
2787
|
-
|
|
2788
|
-
return function (elem) { return isTextNode(elem) && elem.data === data; };
|
|
2789
|
-
}
|
|
2825
|
+
return function (elem) { return isTextNode(elem) && elem.data === data; };
|
|
2790
2826
|
},
|
|
2791
2827
|
};
|
|
2792
|
-
/* eslint-enable @typescript-eslint/camelcase */
|
|
2793
2828
|
function getAttribCheck(attrib, value) {
|
|
2794
2829
|
if (typeof value === "function") {
|
|
2795
2830
|
return function (elem) { return tagtypes_1.isTag(elem) && value(elem.attribs[attrib]); };
|
|
2796
2831
|
}
|
|
2797
|
-
|
|
2798
|
-
return function (elem) { return tagtypes_1.isTag(elem) && elem.attribs[attrib] === value; };
|
|
2799
|
-
}
|
|
2832
|
+
return function (elem) { return tagtypes_1.isTag(elem) && elem.attribs[attrib] === value; };
|
|
2800
2833
|
}
|
|
2801
2834
|
function combineFuncs(a, b) {
|
|
2802
2835
|
return function (elem) { return a(elem) || b(elem); };
|
|
@@ -2843,7 +2876,8 @@ exports.getElementsByTagType = getElementsByTagType;
|
|
|
2843
2876
|
},{"./querying":13,"./tagtypes":15}],12:[function(require,module,exports){
|
|
2844
2877
|
"use strict";
|
|
2845
2878
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2846
|
-
|
|
2879
|
+
exports.prepend = exports.append = exports.appendChild = exports.replaceElement = exports.removeElement = void 0;
|
|
2880
|
+
/**
|
|
2847
2881
|
* Remove an element from the dom
|
|
2848
2882
|
*
|
|
2849
2883
|
* @param elem The element to be removed
|
|
@@ -2859,7 +2893,7 @@ function removeElement(elem) {
|
|
|
2859
2893
|
}
|
|
2860
2894
|
}
|
|
2861
2895
|
exports.removeElement = removeElement;
|
|
2862
|
-
|
|
2896
|
+
/**
|
|
2863
2897
|
* Replace an element in the dom
|
|
2864
2898
|
*
|
|
2865
2899
|
* @param elem The element to be replaced
|
|
@@ -2881,13 +2915,14 @@ function replaceElement(elem, replacement) {
|
|
|
2881
2915
|
}
|
|
2882
2916
|
}
|
|
2883
2917
|
exports.replaceElement = replaceElement;
|
|
2884
|
-
|
|
2918
|
+
/**
|
|
2885
2919
|
* Append a child to an element
|
|
2886
2920
|
*
|
|
2887
2921
|
* @param elem The element to append to
|
|
2888
2922
|
* @param child The element to be added as a child
|
|
2889
2923
|
*/
|
|
2890
2924
|
function appendChild(elem, child) {
|
|
2925
|
+
removeElement(child);
|
|
2891
2926
|
child.parent = elem;
|
|
2892
2927
|
if (elem.children.push(child) !== 1) {
|
|
2893
2928
|
var sibling = elem.children[elem.children.length - 2];
|
|
@@ -2897,13 +2932,14 @@ function appendChild(elem, child) {
|
|
|
2897
2932
|
}
|
|
2898
2933
|
}
|
|
2899
2934
|
exports.appendChild = appendChild;
|
|
2900
|
-
|
|
2935
|
+
/**
|
|
2901
2936
|
* Append an element after another
|
|
2902
2937
|
*
|
|
2903
2938
|
* @param elem The element to append to
|
|
2904
2939
|
* @param next The element be added
|
|
2905
2940
|
*/
|
|
2906
2941
|
function append(elem, next) {
|
|
2942
|
+
removeElement(next);
|
|
2907
2943
|
var parent = elem.parent;
|
|
2908
2944
|
var currNext = elem.next;
|
|
2909
2945
|
next.next = currNext;
|
|
@@ -2922,7 +2958,7 @@ function append(elem, next) {
|
|
|
2922
2958
|
}
|
|
2923
2959
|
}
|
|
2924
2960
|
exports.append = append;
|
|
2925
|
-
|
|
2961
|
+
/**
|
|
2926
2962
|
* Prepend an element before another
|
|
2927
2963
|
*
|
|
2928
2964
|
* @param elem The element to append to
|
|
@@ -2947,6 +2983,7 @@ exports.prepend = prepend;
|
|
|
2947
2983
|
},{}],13:[function(require,module,exports){
|
|
2948
2984
|
"use strict";
|
|
2949
2985
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2986
|
+
exports.findAll = exports.existsOne = exports.findOne = exports.findOneChild = exports.find = exports.filter = void 0;
|
|
2950
2987
|
var tagtypes_1 = require("./tagtypes");
|
|
2951
2988
|
/**
|
|
2952
2989
|
* Search a node and its children for nodes passing a test function.
|
|
@@ -3073,6 +3110,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3073
3110
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
3074
3111
|
};
|
|
3075
3112
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3113
|
+
exports.getText = exports.getInnerHTML = exports.getOuterHTML = void 0;
|
|
3076
3114
|
var tagtypes_1 = require("./tagtypes");
|
|
3077
3115
|
var dom_serializer_1 = __importDefault(require("dom-serializer"));
|
|
3078
3116
|
function getOuterHTML(node, options) {
|
|
@@ -3101,6 +3139,7 @@ exports.getText = getText;
|
|
|
3101
3139
|
},{"./tagtypes":15,"dom-serializer":5}],15:[function(require,module,exports){
|
|
3102
3140
|
"use strict";
|
|
3103
3141
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3142
|
+
exports.hasChildren = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = void 0;
|
|
3104
3143
|
var domelementtype_1 = require("domelementtype");
|
|
3105
3144
|
function isTag(node) {
|
|
3106
3145
|
return domelementtype_1.isTag(node);
|
|
@@ -3126,6 +3165,7 @@ exports.hasChildren = hasChildren;
|
|
|
3126
3165
|
},{"domelementtype":6}],16:[function(require,module,exports){
|
|
3127
3166
|
"use strict";
|
|
3128
3167
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3168
|
+
exports.nextElementSibling = exports.getName = exports.hasAttrib = exports.getAttributeValue = exports.getSiblings = exports.getParent = exports.getChildren = void 0;
|
|
3129
3169
|
function getChildren(elem) {
|
|
3130
3170
|
return elem.children || null;
|
|
3131
3171
|
}
|
|
@@ -3150,7 +3190,7 @@ function hasAttrib(elem, name) {
|
|
|
3150
3190
|
elem.attribs[name] != null);
|
|
3151
3191
|
}
|
|
3152
3192
|
exports.hasAttrib = hasAttrib;
|
|
3153
|
-
|
|
3193
|
+
/**
|
|
3154
3194
|
* Returns the name property of an element
|
|
3155
3195
|
*
|
|
3156
3196
|
* @param elem The element to get the name for
|
|
@@ -3159,6 +3199,13 @@ function getName(elem) {
|
|
|
3159
3199
|
return elem.name;
|
|
3160
3200
|
}
|
|
3161
3201
|
exports.getName = getName;
|
|
3202
|
+
function nextElementSibling(elem) {
|
|
3203
|
+
var node = elem.next;
|
|
3204
|
+
while (node !== null && node.type !== "tag")
|
|
3205
|
+
node = node.next;
|
|
3206
|
+
return node;
|
|
3207
|
+
}
|
|
3208
|
+
exports.nextElementSibling = nextElementSibling;
|
|
3162
3209
|
|
|
3163
3210
|
},{}],17:[function(require,module,exports){
|
|
3164
3211
|
"use strict";
|
|
@@ -3166,6 +3213,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3166
3213
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
3167
3214
|
};
|
|
3168
3215
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3216
|
+
exports.decodeHTML = exports.decodeHTMLStrict = exports.decodeXML = void 0;
|
|
3169
3217
|
var entities_json_1 = __importDefault(require("./maps/entities.json"));
|
|
3170
3218
|
var legacy_json_1 = __importDefault(require("./maps/legacy.json"));
|
|
3171
3219
|
var xml_json_1 = __importDefault(require("./maps/xml.json"));
|
|
@@ -3247,6 +3295,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3247
3295
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
3248
3296
|
};
|
|
3249
3297
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3298
|
+
exports.escape = exports.encodeHTML = exports.encodeXML = void 0;
|
|
3250
3299
|
var xml_json_1 = __importDefault(require("./maps/xml.json"));
|
|
3251
3300
|
var inverseXML = getInverseObj(xml_json_1.default);
|
|
3252
3301
|
var xmlReplacer = getInverseReplacer(inverseXML);
|
|
@@ -3295,7 +3344,7 @@ function getInverseReplacer(inverse) {
|
|
|
3295
3344
|
multiple.unshift("[" + single.join("") + "]");
|
|
3296
3345
|
return new RegExp(multiple.join("|"), "g");
|
|
3297
3346
|
}
|
|
3298
|
-
var reNonASCII = /[^\
|
|
3347
|
+
var reNonASCII = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;
|
|
3299
3348
|
function singleCharReplacer(c) {
|
|
3300
3349
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3301
3350
|
return "&#x" + c.codePointAt(0).toString(16).toUpperCase() + ";";
|
|
@@ -3318,6 +3367,7 @@ exports.escape = escape;
|
|
|
3318
3367
|
},{"./maps/entities.json":22,"./maps/xml.json":24}],20:[function(require,module,exports){
|
|
3319
3368
|
"use strict";
|
|
3320
3369
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3370
|
+
exports.encode = exports.decodeStrict = exports.decode = void 0;
|
|
3321
3371
|
var decode_1 = require("./decode");
|
|
3322
3372
|
var encode_1 = require("./encode");
|
|
3323
3373
|
/**
|
|
@@ -3351,22 +3401,22 @@ function encode(data, level) {
|
|
|
3351
3401
|
}
|
|
3352
3402
|
exports.encode = encode;
|
|
3353
3403
|
var encode_2 = require("./encode");
|
|
3354
|
-
exports
|
|
3355
|
-
exports
|
|
3356
|
-
exports
|
|
3404
|
+
Object.defineProperty(exports, "encodeXML", { enumerable: true, get: function () { return encode_2.encodeXML; } });
|
|
3405
|
+
Object.defineProperty(exports, "encodeHTML", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
|
|
3406
|
+
Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return encode_2.escape; } });
|
|
3357
3407
|
// Legacy aliases
|
|
3358
|
-
exports
|
|
3359
|
-
exports
|
|
3408
|
+
Object.defineProperty(exports, "encodeHTML4", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
|
|
3409
|
+
Object.defineProperty(exports, "encodeHTML5", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
|
|
3360
3410
|
var decode_2 = require("./decode");
|
|
3361
|
-
exports
|
|
3362
|
-
exports
|
|
3363
|
-
exports
|
|
3411
|
+
Object.defineProperty(exports, "decodeXML", { enumerable: true, get: function () { return decode_2.decodeXML; } });
|
|
3412
|
+
Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
|
|
3413
|
+
Object.defineProperty(exports, "decodeHTMLStrict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
|
|
3364
3414
|
// Legacy aliases
|
|
3365
|
-
exports
|
|
3366
|
-
exports
|
|
3367
|
-
exports
|
|
3368
|
-
exports
|
|
3369
|
-
exports
|
|
3415
|
+
Object.defineProperty(exports, "decodeHTML4", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
|
|
3416
|
+
Object.defineProperty(exports, "decodeHTML5", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
|
|
3417
|
+
Object.defineProperty(exports, "decodeHTML4Strict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
|
|
3418
|
+
Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
|
|
3419
|
+
Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function () { return decode_2.decodeXML; } });
|
|
3370
3420
|
|
|
3371
3421
|
},{"./decode":17,"./encode":19}],21:[function(require,module,exports){
|
|
3372
3422
|
module.exports={
|
|
@@ -10006,9 +10056,7 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
|
|
|
10006
10056
|
* const media = root.last
|
|
10007
10057
|
* media.nodes //=> []
|
|
10008
10058
|
*/
|
|
10009
|
-
var AtRule =
|
|
10010
|
-
/*#__PURE__*/
|
|
10011
|
-
function (_Container) {
|
|
10059
|
+
var AtRule = /*#__PURE__*/function (_Container) {
|
|
10012
10060
|
_inheritsLoose(AtRule, _Container);
|
|
10013
10061
|
|
|
10014
10062
|
function AtRule(defaults) {
|
|
@@ -10127,9 +10175,7 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
|
|
|
10127
10175
|
*
|
|
10128
10176
|
* @extends Node
|
|
10129
10177
|
*/
|
|
10130
|
-
var Comment =
|
|
10131
|
-
/*#__PURE__*/
|
|
10132
|
-
function (_Node) {
|
|
10178
|
+
var Comment = /*#__PURE__*/function (_Node) {
|
|
10133
10179
|
_inheritsLoose(Comment, _Node);
|
|
10134
10180
|
|
|
10135
10181
|
function Comment(defaults) {
|
|
@@ -10180,6 +10226,12 @@ var _node = _interopRequireDefault(require("./node"));
|
|
|
10180
10226
|
|
|
10181
10227
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10182
10228
|
|
|
10229
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
|
|
10230
|
+
|
|
10231
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10232
|
+
|
|
10233
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10234
|
+
|
|
10183
10235
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
10184
10236
|
|
|
10185
10237
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
@@ -10205,9 +10257,7 @@ function cleanSource(nodes) {
|
|
|
10205
10257
|
*/
|
|
10206
10258
|
|
|
10207
10259
|
|
|
10208
|
-
var Container =
|
|
10209
|
-
/*#__PURE__*/
|
|
10210
|
-
function (_Node) {
|
|
10260
|
+
var Container = /*#__PURE__*/function (_Node) {
|
|
10211
10261
|
_inheritsLoose(Container, _Node);
|
|
10212
10262
|
|
|
10213
10263
|
function Container() {
|
|
@@ -10536,19 +10586,8 @@ function (_Node) {
|
|
|
10536
10586
|
var child = _children[_i];
|
|
10537
10587
|
var nodes = this.normalize(child, this.last);
|
|
10538
10588
|
|
|
10539
|
-
for (var _iterator = nodes,
|
|
10540
|
-
var
|
|
10541
|
-
|
|
10542
|
-
if (_isArray) {
|
|
10543
|
-
if (_i2 >= _iterator.length) break;
|
|
10544
|
-
_ref = _iterator[_i2++];
|
|
10545
|
-
} else {
|
|
10546
|
-
_i2 = _iterator.next();
|
|
10547
|
-
if (_i2.done) break;
|
|
10548
|
-
_ref = _i2.value;
|
|
10549
|
-
}
|
|
10550
|
-
|
|
10551
|
-
var node = _ref;
|
|
10589
|
+
for (var _iterator = _createForOfIteratorHelperLoose(nodes), _step; !(_step = _iterator()).done;) {
|
|
10590
|
+
var node = _step.value;
|
|
10552
10591
|
this.nodes.push(node);
|
|
10553
10592
|
}
|
|
10554
10593
|
}
|
|
@@ -10584,34 +10623,12 @@ function (_Node) {
|
|
|
10584
10623
|
|
|
10585
10624
|
children = children.reverse();
|
|
10586
10625
|
|
|
10587
|
-
for (var _iterator2 = children,
|
|
10588
|
-
var
|
|
10589
|
-
|
|
10590
|
-
if (_isArray2) {
|
|
10591
|
-
if (_i3 >= _iterator2.length) break;
|
|
10592
|
-
_ref2 = _iterator2[_i3++];
|
|
10593
|
-
} else {
|
|
10594
|
-
_i3 = _iterator2.next();
|
|
10595
|
-
if (_i3.done) break;
|
|
10596
|
-
_ref2 = _i3.value;
|
|
10597
|
-
}
|
|
10598
|
-
|
|
10599
|
-
var child = _ref2;
|
|
10626
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(children), _step2; !(_step2 = _iterator2()).done;) {
|
|
10627
|
+
var child = _step2.value;
|
|
10600
10628
|
var nodes = this.normalize(child, this.first, 'prepend').reverse();
|
|
10601
10629
|
|
|
10602
|
-
for (var _iterator3 = nodes,
|
|
10603
|
-
var
|
|
10604
|
-
|
|
10605
|
-
if (_isArray3) {
|
|
10606
|
-
if (_i4 >= _iterator3.length) break;
|
|
10607
|
-
_ref3 = _iterator3[_i4++];
|
|
10608
|
-
} else {
|
|
10609
|
-
_i4 = _iterator3.next();
|
|
10610
|
-
if (_i4.done) break;
|
|
10611
|
-
_ref3 = _i4.value;
|
|
10612
|
-
}
|
|
10613
|
-
|
|
10614
|
-
var node = _ref3;
|
|
10630
|
+
for (var _iterator3 = _createForOfIteratorHelperLoose(nodes), _step3; !(_step3 = _iterator3()).done;) {
|
|
10631
|
+
var node = _step3.value;
|
|
10615
10632
|
this.nodes.unshift(node);
|
|
10616
10633
|
}
|
|
10617
10634
|
|
|
@@ -10627,19 +10644,8 @@ function (_Node) {
|
|
|
10627
10644
|
_Node.prototype.cleanRaws.call(this, keepBetween);
|
|
10628
10645
|
|
|
10629
10646
|
if (this.nodes) {
|
|
10630
|
-
for (var _iterator4 = this.nodes,
|
|
10631
|
-
var
|
|
10632
|
-
|
|
10633
|
-
if (_isArray4) {
|
|
10634
|
-
if (_i5 >= _iterator4.length) break;
|
|
10635
|
-
_ref4 = _iterator4[_i5++];
|
|
10636
|
-
} else {
|
|
10637
|
-
_i5 = _iterator4.next();
|
|
10638
|
-
if (_i5.done) break;
|
|
10639
|
-
_ref4 = _i5.value;
|
|
10640
|
-
}
|
|
10641
|
-
|
|
10642
|
-
var node = _ref4;
|
|
10647
|
+
for (var _iterator4 = _createForOfIteratorHelperLoose(this.nodes), _step4; !(_step4 = _iterator4()).done;) {
|
|
10648
|
+
var node = _step4.value;
|
|
10643
10649
|
node.cleanRaws(keepBetween);
|
|
10644
10650
|
}
|
|
10645
10651
|
}
|
|
@@ -10662,19 +10668,8 @@ function (_Node) {
|
|
|
10662
10668
|
var type = exist === 0 ? 'prepend' : false;
|
|
10663
10669
|
var nodes = this.normalize(add, this.nodes[exist], type).reverse();
|
|
10664
10670
|
|
|
10665
|
-
for (var _iterator5 = nodes,
|
|
10666
|
-
var
|
|
10667
|
-
|
|
10668
|
-
if (_isArray5) {
|
|
10669
|
-
if (_i6 >= _iterator5.length) break;
|
|
10670
|
-
_ref5 = _iterator5[_i6++];
|
|
10671
|
-
} else {
|
|
10672
|
-
_i6 = _iterator5.next();
|
|
10673
|
-
if (_i6.done) break;
|
|
10674
|
-
_ref5 = _i6.value;
|
|
10675
|
-
}
|
|
10676
|
-
|
|
10677
|
-
var node = _ref5;
|
|
10671
|
+
for (var _iterator5 = _createForOfIteratorHelperLoose(nodes), _step5; !(_step5 = _iterator5()).done;) {
|
|
10672
|
+
var node = _step5.value;
|
|
10678
10673
|
this.nodes.splice(exist, 0, node);
|
|
10679
10674
|
}
|
|
10680
10675
|
|
|
@@ -10704,19 +10699,8 @@ function (_Node) {
|
|
|
10704
10699
|
exist = this.index(exist);
|
|
10705
10700
|
var nodes = this.normalize(add, this.nodes[exist]).reverse();
|
|
10706
10701
|
|
|
10707
|
-
for (var _iterator6 = nodes,
|
|
10708
|
-
var
|
|
10709
|
-
|
|
10710
|
-
if (_isArray6) {
|
|
10711
|
-
if (_i7 >= _iterator6.length) break;
|
|
10712
|
-
_ref6 = _iterator6[_i7++];
|
|
10713
|
-
} else {
|
|
10714
|
-
_i7 = _iterator6.next();
|
|
10715
|
-
if (_i7.done) break;
|
|
10716
|
-
_ref6 = _i7.value;
|
|
10717
|
-
}
|
|
10718
|
-
|
|
10719
|
-
var node = _ref6;
|
|
10702
|
+
for (var _iterator6 = _createForOfIteratorHelperLoose(nodes), _step6; !(_step6 = _iterator6()).done;) {
|
|
10703
|
+
var node = _step6.value;
|
|
10720
10704
|
this.nodes.splice(exist + 1, 0, node);
|
|
10721
10705
|
}
|
|
10722
10706
|
|
|
@@ -10777,19 +10761,8 @@ function (_Node) {
|
|
|
10777
10761
|
;
|
|
10778
10762
|
|
|
10779
10763
|
_proto.removeAll = function removeAll() {
|
|
10780
|
-
for (var _iterator7 = this.nodes,
|
|
10781
|
-
var
|
|
10782
|
-
|
|
10783
|
-
if (_isArray7) {
|
|
10784
|
-
if (_i8 >= _iterator7.length) break;
|
|
10785
|
-
_ref7 = _iterator7[_i8++];
|
|
10786
|
-
} else {
|
|
10787
|
-
_i8 = _iterator7.next();
|
|
10788
|
-
if (_i8.done) break;
|
|
10789
|
-
_ref7 = _i8.value;
|
|
10790
|
-
}
|
|
10791
|
-
|
|
10792
|
-
var node = _ref7;
|
|
10764
|
+
for (var _iterator7 = _createForOfIteratorHelperLoose(this.nodes), _step7; !(_step7 = _iterator7()).done;) {
|
|
10765
|
+
var node = _step7.value;
|
|
10793
10766
|
node.parent = undefined;
|
|
10794
10767
|
}
|
|
10795
10768
|
|
|
@@ -10908,38 +10881,16 @@ function (_Node) {
|
|
|
10908
10881
|
} else if (Array.isArray(nodes)) {
|
|
10909
10882
|
nodes = nodes.slice(0);
|
|
10910
10883
|
|
|
10911
|
-
for (var _iterator8 = nodes,
|
|
10912
|
-
var
|
|
10913
|
-
|
|
10914
|
-
if (_isArray8) {
|
|
10915
|
-
if (_i9 >= _iterator8.length) break;
|
|
10916
|
-
_ref8 = _iterator8[_i9++];
|
|
10917
|
-
} else {
|
|
10918
|
-
_i9 = _iterator8.next();
|
|
10919
|
-
if (_i9.done) break;
|
|
10920
|
-
_ref8 = _i9.value;
|
|
10921
|
-
}
|
|
10922
|
-
|
|
10923
|
-
var i = _ref8;
|
|
10884
|
+
for (var _iterator8 = _createForOfIteratorHelperLoose(nodes), _step8; !(_step8 = _iterator8()).done;) {
|
|
10885
|
+
var i = _step8.value;
|
|
10924
10886
|
if (i.parent) i.parent.removeChild(i, 'ignore');
|
|
10925
10887
|
}
|
|
10926
10888
|
} else if (nodes.type === 'root') {
|
|
10927
10889
|
nodes = nodes.nodes.slice(0);
|
|
10928
10890
|
|
|
10929
|
-
for (var _iterator9 = nodes,
|
|
10930
|
-
var
|
|
10931
|
-
|
|
10932
|
-
if (_isArray9) {
|
|
10933
|
-
if (_i10 >= _iterator9.length) break;
|
|
10934
|
-
_ref9 = _iterator9[_i10++];
|
|
10935
|
-
} else {
|
|
10936
|
-
_i10 = _iterator9.next();
|
|
10937
|
-
if (_i10.done) break;
|
|
10938
|
-
_ref9 = _i10.value;
|
|
10939
|
-
}
|
|
10940
|
-
|
|
10941
|
-
var _i11 = _ref9;
|
|
10942
|
-
if (_i11.parent) _i11.parent.removeChild(_i11, 'ignore');
|
|
10891
|
+
for (var _iterator9 = _createForOfIteratorHelperLoose(nodes), _step9; !(_step9 = _iterator9()).done;) {
|
|
10892
|
+
var _i2 = _step9.value;
|
|
10893
|
+
if (_i2.parent) _i2.parent.removeChild(_i2, 'ignore');
|
|
10943
10894
|
}
|
|
10944
10895
|
} else if (nodes.type) {
|
|
10945
10896
|
nodes = [nodes];
|
|
@@ -11057,9 +11008,9 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
|
|
|
11057
11008
|
|
|
11058
11009
|
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
|
11059
11010
|
|
|
11060
|
-
function
|
|
11011
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
11061
11012
|
|
|
11062
|
-
function
|
|
11013
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
11063
11014
|
|
|
11064
11015
|
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
11065
11016
|
|
|
@@ -11094,9 +11045,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
11094
11045
|
* // Raising error from plugin
|
|
11095
11046
|
* throw node.error('Unknown variable', { plugin: 'postcss-vars' })
|
|
11096
11047
|
*/
|
|
11097
|
-
var CssSyntaxError =
|
|
11098
|
-
/*#__PURE__*/
|
|
11099
|
-
function (_Error) {
|
|
11048
|
+
var CssSyntaxError = /*#__PURE__*/function (_Error) {
|
|
11100
11049
|
_inheritsLoose(CssSyntaxError, _Error);
|
|
11101
11050
|
|
|
11102
11051
|
/**
|
|
@@ -11332,7 +11281,7 @@ function (_Error) {
|
|
|
11332
11281
|
;
|
|
11333
11282
|
|
|
11334
11283
|
return CssSyntaxError;
|
|
11335
|
-
}(_wrapNativeSuper(Error));
|
|
11284
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
11336
11285
|
|
|
11337
11286
|
var _default = CssSyntaxError;
|
|
11338
11287
|
exports.default = _default;
|
|
@@ -11362,9 +11311,7 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
|
|
|
11362
11311
|
* decl.type //=> 'decl'
|
|
11363
11312
|
* decl.toString() //=> ' color: black'
|
|
11364
11313
|
*/
|
|
11365
|
-
var Declaration =
|
|
11366
|
-
/*#__PURE__*/
|
|
11367
|
-
function (_Node) {
|
|
11314
|
+
var Declaration = /*#__PURE__*/function (_Node) {
|
|
11368
11315
|
_inheritsLoose(Declaration, _Node);
|
|
11369
11316
|
|
|
11370
11317
|
function Declaration(defaults) {
|
|
@@ -11466,9 +11413,7 @@ var sequence = 0;
|
|
|
11466
11413
|
* const input = root.source.input
|
|
11467
11414
|
*/
|
|
11468
11415
|
|
|
11469
|
-
var Input =
|
|
11470
|
-
/*#__PURE__*/
|
|
11471
|
-
function () {
|
|
11416
|
+
var Input = /*#__PURE__*/function () {
|
|
11472
11417
|
/**
|
|
11473
11418
|
* @param {string} css Input CSS source.
|
|
11474
11419
|
* @param {object} [opts] {@link Processor#process} options.
|
|
@@ -11478,7 +11423,7 @@ function () {
|
|
|
11478
11423
|
opts = {};
|
|
11479
11424
|
}
|
|
11480
11425
|
|
|
11481
|
-
if (css === null || typeof css === 'object' && !css.toString) {
|
|
11426
|
+
if (css === null || typeof css === 'undefined' || typeof css === 'object' && !css.toString) {
|
|
11482
11427
|
throw new Error("PostCSS received " + css + " instead of CSS string");
|
|
11483
11428
|
}
|
|
11484
11429
|
/**
|
|
@@ -11676,6 +11621,12 @@ var _parse = _interopRequireDefault(require("./parse"));
|
|
|
11676
11621
|
|
|
11677
11622
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11678
11623
|
|
|
11624
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
|
|
11625
|
+
|
|
11626
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11627
|
+
|
|
11628
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11629
|
+
|
|
11679
11630
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
11680
11631
|
|
|
11681
11632
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
@@ -11693,9 +11644,7 @@ function isPromise(obj) {
|
|
|
11693
11644
|
*/
|
|
11694
11645
|
|
|
11695
11646
|
|
|
11696
|
-
var LazyResult =
|
|
11697
|
-
/*#__PURE__*/
|
|
11698
|
-
function () {
|
|
11647
|
+
var LazyResult = /*#__PURE__*/function () {
|
|
11699
11648
|
function LazyResult(processor, css, opts) {
|
|
11700
11649
|
this.stringified = false;
|
|
11701
11650
|
this.processed = false;
|
|
@@ -11926,19 +11875,8 @@ function () {
|
|
|
11926
11875
|
|
|
11927
11876
|
if (this.error) throw this.error;
|
|
11928
11877
|
|
|
11929
|
-
for (var _iterator = this.result.processor.plugins,
|
|
11930
|
-
var
|
|
11931
|
-
|
|
11932
|
-
if (_isArray) {
|
|
11933
|
-
if (_i >= _iterator.length) break;
|
|
11934
|
-
_ref = _iterator[_i++];
|
|
11935
|
-
} else {
|
|
11936
|
-
_i = _iterator.next();
|
|
11937
|
-
if (_i.done) break;
|
|
11938
|
-
_ref = _i.value;
|
|
11939
|
-
}
|
|
11940
|
-
|
|
11941
|
-
var plugin = _ref;
|
|
11878
|
+
for (var _iterator = _createForOfIteratorHelperLoose(this.result.processor.plugins), _step; !(_step = _iterator()).done;) {
|
|
11879
|
+
var plugin = _step.value;
|
|
11942
11880
|
var promise = this.run(plugin);
|
|
11943
11881
|
|
|
11944
11882
|
if (isPromise(promise)) {
|
|
@@ -12213,9 +12151,13 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
12213
12151
|
|
|
12214
12152
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12215
12153
|
|
|
12216
|
-
var
|
|
12217
|
-
|
|
12218
|
-
function () {
|
|
12154
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
|
|
12155
|
+
|
|
12156
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12157
|
+
|
|
12158
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12159
|
+
|
|
12160
|
+
var MapGenerator = /*#__PURE__*/function () {
|
|
12219
12161
|
function MapGenerator(stringify, root, opts) {
|
|
12220
12162
|
this.stringify = stringify;
|
|
12221
12163
|
this.mapOpts = opts.map || {};
|
|
@@ -12320,19 +12262,8 @@ function () {
|
|
|
12320
12262
|
};
|
|
12321
12263
|
|
|
12322
12264
|
_proto.applyPrevMaps = function applyPrevMaps() {
|
|
12323
|
-
for (var _iterator = this.previous(),
|
|
12324
|
-
var
|
|
12325
|
-
|
|
12326
|
-
if (_isArray) {
|
|
12327
|
-
if (_i >= _iterator.length) break;
|
|
12328
|
-
_ref = _iterator[_i++];
|
|
12329
|
-
} else {
|
|
12330
|
-
_i = _iterator.next();
|
|
12331
|
-
if (_i.done) break;
|
|
12332
|
-
_ref = _i.value;
|
|
12333
|
-
}
|
|
12334
|
-
|
|
12335
|
-
var prev = _ref;
|
|
12265
|
+
for (var _iterator = _createForOfIteratorHelperLoose(this.previous()), _step; !(_step = _iterator()).done;) {
|
|
12266
|
+
var prev = _step.value;
|
|
12336
12267
|
var from = this.relative(prev.file);
|
|
12337
12268
|
|
|
12338
12269
|
var root = prev.root || _path.default.dirname(prev.file);
|
|
@@ -12604,9 +12535,7 @@ function cloneNode(obj, parent) {
|
|
|
12604
12535
|
*/
|
|
12605
12536
|
|
|
12606
12537
|
|
|
12607
|
-
var Node =
|
|
12608
|
-
/*#__PURE__*/
|
|
12609
|
-
function () {
|
|
12538
|
+
var Node = /*#__PURE__*/function () {
|
|
12610
12539
|
/**
|
|
12611
12540
|
* @param {object} [defaults] Value for node properties.
|
|
12612
12541
|
*/
|
|
@@ -13234,9 +13163,7 @@ var _rule = _interopRequireDefault(require("./rule"));
|
|
|
13234
13163
|
|
|
13235
13164
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13236
13165
|
|
|
13237
|
-
var Parser =
|
|
13238
|
-
/*#__PURE__*/
|
|
13239
|
-
function () {
|
|
13166
|
+
var Parser = /*#__PURE__*/function () {
|
|
13240
13167
|
function Parser(input) {
|
|
13241
13168
|
this.input = input;
|
|
13242
13169
|
this.root = new _root.default();
|
|
@@ -14149,9 +14076,7 @@ function fromBase64(str) {
|
|
|
14149
14076
|
*/
|
|
14150
14077
|
|
|
14151
14078
|
|
|
14152
|
-
var PreviousMap =
|
|
14153
|
-
/*#__PURE__*/
|
|
14154
|
-
function () {
|
|
14079
|
+
var PreviousMap = /*#__PURE__*/function () {
|
|
14155
14080
|
/**
|
|
14156
14081
|
* @param {string} css Input CSS source.
|
|
14157
14082
|
* @param {processOptions} [opts] {@link Processor#process} options.
|
|
@@ -14303,6 +14228,12 @@ var _lazyResult = _interopRequireDefault(require("./lazy-result"));
|
|
|
14303
14228
|
|
|
14304
14229
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14305
14230
|
|
|
14231
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
|
|
14232
|
+
|
|
14233
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14234
|
+
|
|
14235
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14236
|
+
|
|
14306
14237
|
/**
|
|
14307
14238
|
* Contains plugins to process CSS. Create one `Processor` instance,
|
|
14308
14239
|
* initialize its plugins, and then use that instance on numerous CSS files.
|
|
@@ -14312,9 +14243,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
14312
14243
|
* processor.process(css1).then(result => console.log(result.css))
|
|
14313
14244
|
* processor.process(css2).then(result => console.log(result.css))
|
|
14314
14245
|
*/
|
|
14315
|
-
var Processor =
|
|
14316
|
-
/*#__PURE__*/
|
|
14317
|
-
function () {
|
|
14246
|
+
var Processor = /*#__PURE__*/function () {
|
|
14318
14247
|
/**
|
|
14319
14248
|
* @param {Array.<Plugin|pluginFunction>|Processor} plugins PostCSS plugins.
|
|
14320
14249
|
* See {@link Processor#use} for plugin format.
|
|
@@ -14334,7 +14263,7 @@ function () {
|
|
|
14334
14263
|
* throw new Error('This plugin works only with PostCSS 6')
|
|
14335
14264
|
* }
|
|
14336
14265
|
*/
|
|
14337
|
-
this.version = '7.0.
|
|
14266
|
+
this.version = '7.0.34';
|
|
14338
14267
|
/**
|
|
14339
14268
|
* Plugins added to this processor.
|
|
14340
14269
|
*
|
|
@@ -14437,19 +14366,14 @@ function () {
|
|
|
14437
14366
|
_proto.normalize = function normalize(plugins) {
|
|
14438
14367
|
var normalized = [];
|
|
14439
14368
|
|
|
14440
|
-
for (var _iterator = plugins,
|
|
14441
|
-
var
|
|
14369
|
+
for (var _iterator = _createForOfIteratorHelperLoose(plugins), _step; !(_step = _iterator()).done;) {
|
|
14370
|
+
var i = _step.value;
|
|
14442
14371
|
|
|
14443
|
-
if (
|
|
14444
|
-
|
|
14445
|
-
|
|
14446
|
-
} else {
|
|
14447
|
-
_i = _iterator.next();
|
|
14448
|
-
if (_i.done) break;
|
|
14449
|
-
_ref = _i.value;
|
|
14372
|
+
if (i.postcss === true) {
|
|
14373
|
+
var plugin = i();
|
|
14374
|
+
throw new Error('PostCSS plugin ' + plugin.postcssPlugin + ' requires PostCSS 8. Update PostCSS or downgrade this plugin.');
|
|
14450
14375
|
}
|
|
14451
14376
|
|
|
14452
|
-
var i = _ref;
|
|
14453
14377
|
if (i.postcss) i = i.postcss;
|
|
14454
14378
|
|
|
14455
14379
|
if (typeof i === 'object' && Array.isArray(i.plugins)) {
|
|
@@ -14460,6 +14384,8 @@ function () {
|
|
|
14460
14384
|
if (process.env.NODE_ENV !== 'production') {
|
|
14461
14385
|
throw new Error('PostCSS syntaxes cannot be used as plugins. Instead, please use ' + 'one of the syntax/parser/stringifier options as outlined ' + 'in your PostCSS runner documentation.');
|
|
14462
14386
|
}
|
|
14387
|
+
} else if (typeof i === 'object' && i.postcssPlugin) {
|
|
14388
|
+
throw new Error('PostCSS plugin ' + i.postcssPlugin + ' requires PostCSS 8. Update PostCSS or downgrade this plugin.');
|
|
14463
14389
|
} else {
|
|
14464
14390
|
throw new Error(i + ' is not a PostCSS plugin');
|
|
14465
14391
|
}
|
|
@@ -14587,9 +14513,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
14587
14513
|
* @example
|
|
14588
14514
|
* const result2 = postcss.parse(css).toResult()
|
|
14589
14515
|
*/
|
|
14590
|
-
var Result =
|
|
14591
|
-
/*#__PURE__*/
|
|
14592
|
-
function () {
|
|
14516
|
+
var Result = /*#__PURE__*/function () {
|
|
14593
14517
|
/**
|
|
14594
14518
|
* @param {Processor} processor Processor used for this transformation.
|
|
14595
14519
|
* @param {Root} root Root node after all transformations.
|
|
@@ -14786,6 +14710,12 @@ var _container = _interopRequireDefault(require("./container"));
|
|
|
14786
14710
|
|
|
14787
14711
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14788
14712
|
|
|
14713
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
|
|
14714
|
+
|
|
14715
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14716
|
+
|
|
14717
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14718
|
+
|
|
14789
14719
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
14790
14720
|
|
|
14791
14721
|
/**
|
|
@@ -14798,9 +14728,7 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
|
|
|
14798
14728
|
* root.type //=> 'root'
|
|
14799
14729
|
* root.nodes.length //=> 2
|
|
14800
14730
|
*/
|
|
14801
|
-
var Root =
|
|
14802
|
-
/*#__PURE__*/
|
|
14803
|
-
function (_Container) {
|
|
14731
|
+
var Root = /*#__PURE__*/function (_Container) {
|
|
14804
14732
|
_inheritsLoose(Root, _Container);
|
|
14805
14733
|
|
|
14806
14734
|
function Root(defaults) {
|
|
@@ -14835,19 +14763,8 @@ function (_Container) {
|
|
|
14835
14763
|
delete sample.raws.before;
|
|
14836
14764
|
}
|
|
14837
14765
|
} else if (this.first !== sample) {
|
|
14838
|
-
for (var _iterator = nodes,
|
|
14839
|
-
var
|
|
14840
|
-
|
|
14841
|
-
if (_isArray) {
|
|
14842
|
-
if (_i >= _iterator.length) break;
|
|
14843
|
-
_ref = _iterator[_i++];
|
|
14844
|
-
} else {
|
|
14845
|
-
_i = _iterator.next();
|
|
14846
|
-
if (_i.done) break;
|
|
14847
|
-
_ref = _i.value;
|
|
14848
|
-
}
|
|
14849
|
-
|
|
14850
|
-
var node = _ref;
|
|
14766
|
+
for (var _iterator = _createForOfIteratorHelperLoose(nodes), _step; !(_step = _iterator()).done;) {
|
|
14767
|
+
var node = _step.value;
|
|
14851
14768
|
node.raws.before = sample.raws.before;
|
|
14852
14769
|
}
|
|
14853
14770
|
}
|
|
@@ -14936,9 +14853,7 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
|
|
|
14936
14853
|
* rule.type //=> 'rule'
|
|
14937
14854
|
* rule.toString() //=> 'a{}'
|
|
14938
14855
|
*/
|
|
14939
|
-
var Rule =
|
|
14940
|
-
/*#__PURE__*/
|
|
14941
|
-
function (_Container) {
|
|
14856
|
+
var Rule = /*#__PURE__*/function (_Container) {
|
|
14942
14857
|
_inheritsLoose(Rule, _Container);
|
|
14943
14858
|
|
|
14944
14859
|
function Rule(defaults) {
|
|
@@ -15051,9 +14966,7 @@ function capitalize(str) {
|
|
|
15051
14966
|
return str[0].toUpperCase() + str.slice(1);
|
|
15052
14967
|
}
|
|
15053
14968
|
|
|
15054
|
-
var Stringifier =
|
|
15055
|
-
/*#__PURE__*/
|
|
15056
|
-
function () {
|
|
14969
|
+
var Stringifier = /*#__PURE__*/function () {
|
|
15057
14970
|
function Stringifier(builder) {
|
|
15058
14971
|
this.builder = builder;
|
|
15059
14972
|
}
|
|
@@ -15798,9 +15711,7 @@ exports.default = void 0;
|
|
|
15798
15711
|
* decl.warn(result, 'Avoid !important', { word: '!important' })
|
|
15799
15712
|
* }
|
|
15800
15713
|
*/
|
|
15801
|
-
var Warning =
|
|
15802
|
-
/*#__PURE__*/
|
|
15803
|
-
function () {
|
|
15714
|
+
var Warning = /*#__PURE__*/function () {
|
|
15804
15715
|
/**
|
|
15805
15716
|
* @param {string} text Warning message.
|
|
15806
15717
|
* @param {Object} [opts] Warning options.
|
|
@@ -20723,7 +20634,7 @@ var mediaTags = [
|
|
|
20723
20634
|
'object', 'map', 'iframe', 'embed'
|
|
20724
20635
|
];
|
|
20725
20636
|
// Tags that are inherently vulnerable to being used in XSS attacks.
|
|
20726
|
-
var vulnerableTags = ['script', 'style'];
|
|
20637
|
+
var vulnerableTags = [ 'script', 'style' ];
|
|
20727
20638
|
|
|
20728
20639
|
function each(obj, cb) {
|
|
20729
20640
|
if (obj) {
|
|
@@ -21026,7 +20937,8 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
21026
20937
|
var allowed = true;
|
|
21027
20938
|
try {
|
|
21028
20939
|
// naughtyHref is in charge of whether protocol relative URLs
|
|
21029
|
-
// are cool. We should just accept them
|
|
20940
|
+
// are cool. We should just accept them.
|
|
20941
|
+
// eslint-disable-next-line node/no-deprecated-api
|
|
21030
20942
|
parsed = url.parse(value, false, true);
|
|
21031
20943
|
var isRelativeUrl = parsed && parsed.host === null && parsed.protocol === null;
|
|
21032
20944
|
if (isRelativeUrl) {
|
|
@@ -21356,7 +21268,7 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
21356
21268
|
function filterDeclarations(selectedRule) {
|
|
21357
21269
|
return function (allowedDeclarationsList, attributeObject) {
|
|
21358
21270
|
// If this property is whitelisted...
|
|
21359
|
-
if (selectedRule
|
|
21271
|
+
if (has(selectedRule, attributeObject.prop)) {
|
|
21360
21272
|
var matchesRegex = selectedRule[attributeObject.prop].some(function(regularExpression) {
|
|
21361
21273
|
return regularExpression.test(attributeObject.value);
|
|
21362
21274
|
});
|
|
@@ -21388,23 +21300,23 @@ var htmlParserDefaults = {
|
|
|
21388
21300
|
decodeEntities: true
|
|
21389
21301
|
};
|
|
21390
21302
|
sanitizeHtml.defaults = {
|
|
21391
|
-
allowedTags: ['h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol',
|
|
21303
|
+
allowedTags: [ 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol',
|
|
21392
21304
|
'nl', 'li', 'b', 'i', 'strong', 'em', 'strike', 'abbr', 'code', 'hr', 'br', 'div',
|
|
21393
|
-
'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre', 'iframe'],
|
|
21305
|
+
'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre', 'iframe' ],
|
|
21394
21306
|
disallowedTagsMode: 'discard',
|
|
21395
21307
|
allowedAttributes: {
|
|
21396
|
-
a: ['href', 'name', 'target'],
|
|
21308
|
+
a: [ 'href', 'name', 'target' ],
|
|
21397
21309
|
// We don't currently allow img itself by default, but this
|
|
21398
21310
|
// would make sense if we did. You could add srcset here,
|
|
21399
21311
|
// and if you do the URL is checked for safety
|
|
21400
|
-
img: ['src']
|
|
21312
|
+
img: [ 'src' ]
|
|
21401
21313
|
},
|
|
21402
21314
|
// Lots of these won't come up by default because we don't allow them
|
|
21403
|
-
selfClosing: ['img', 'br', 'hr', 'area', 'base', 'basefont', 'input', 'link', 'meta'],
|
|
21315
|
+
selfClosing: [ 'img', 'br', 'hr', 'area', 'base', 'basefont', 'input', 'link', 'meta' ],
|
|
21404
21316
|
// URL schemes we permit
|
|
21405
|
-
allowedSchemes: ['http', 'https', 'ftp', 'mailto'],
|
|
21317
|
+
allowedSchemes: [ 'http', 'https', 'ftp', 'mailto' ],
|
|
21406
21318
|
allowedSchemesByTag: {},
|
|
21407
|
-
allowedSchemesAppliedToAttributes: ['href', 'src', 'cite'],
|
|
21319
|
+
allowedSchemesAppliedToAttributes: [ 'href', 'src', 'cite' ],
|
|
21408
21320
|
allowProtocolRelative: true,
|
|
21409
21321
|
enforceHtmlBoundary: false
|
|
21410
21322
|
};
|