Commit 16e7f5fb authored by Roy Revelt's avatar Roy Revelt

[skip ci] chore: automated build tasks

parent b3cb93bf
This diff is collapsed.
......@@ -22,6 +22,5 @@ test
.babelrc
.npmignore
.prettierignore
ideas.md
rollup.config.js
testStats.md
......@@ -3030,8 +3030,10 @@
*/
const allHTMLTagsKnownToHumanity = ["a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "command", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "isindex", "kbd", "keygen", "label", "legend", "li", "link", "listing", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "multicol", "nav", "nextid", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp"];
const espChars = `{}%-$_()*|#`;
const espLumpBlacklist = [")|(", "|(", ")(", "()", "{}", "%)", "*)", "**"];
const punctuationChars = [".", ",", ";", "!", "?"];
const veryEspChars = `{}()|#`;
const notVeryEspChars = `%$_*#`;
const espLumpBlacklist = [")|(", "|(", ")(", "()", "}{", "{}", "%)", "*)"];
const punctuationChars = `.,;!?`;
function isStr$3(something) {
return typeof something === "string";
......@@ -3183,7 +3185,7 @@
}
function startsEsp(str, i, token, layers, styleStarts) {
const res = espChars.includes(str[i]) && str[i + 1] && espChars.includes(str[i + 1]) && token.type !== "rule" && token.type !== "at" && !(str[i] === "-" && "-{(".includes(str[i + 1])) && !("})".includes(str[i]) && "-".includes(str[i + 1])) && !(str[i] === "%" && str[i + 1] === "%" && "0123456789".includes(str[i - 1]) && (!str[i + 2] || punctuationChars.includes(str[i + 2]) || !str[i + 2].trim().length)) && !(styleStarts && ("{}".includes(str[i]) || "{}".includes(str[right(str, i)]))) || str[i] === "<" && (str[i + 1] === "/" && espChars.includes(str[i + 2]) || espChars.includes(str[i + 1]) && !["-"].includes(str[i + 1])) || `>})`.includes(str[i]) && Array.isArray(layers) && layers.length && layers[layers.length - 1].type === "esp" && layers[layers.length - 1].openingLump.includes(flipEspTag(str[i])) && (str[i] !== ">" || !xBeforeYOnTheRight$1(str, i + 1, ">", "<")) || str[i] === "-" && str[i + 1] === "-" && str[i + 2] === ">" && Array.isArray(layers) && layers.length && layers[layers.length - 1].type === "esp" && layers[layers.length - 1].openingLump[0] === "<" && layers[layers.length - 1].openingLump[2] === "-" && layers[layers.length - 1].openingLump[3] === "-";
const res = espChars.includes(str[i]) && str[i + 1] && espChars.includes(str[i + 1]) && !(notVeryEspChars.includes(str[i]) && notVeryEspChars.includes(str[i + 1])) && (str[i] !== str[i + 1] || veryEspChars.includes(str[i])) && token.type !== "rule" && token.type !== "at" && !(str[i] === "-" && "-{(".includes(str[i + 1])) && !("})".includes(str[i]) && "-".includes(str[i + 1])) && !(str[i] === "%" && str[i + 1] === "%" && "0123456789".includes(str[i - 1]) && (!str[i + 2] || punctuationChars.includes(str[i + 2]) || !str[i + 2].trim().length)) && !(styleStarts && ("{}".includes(str[i]) || "{}".includes(str[right(str, i)]))) || str[i] === "<" && (str[i + 1] === "/" && espChars.includes(str[i + 2]) || espChars.includes(str[i + 1]) && !["-"].includes(str[i + 1])) || `>})`.includes(str[i]) && Array.isArray(layers) && layers.length && layers[layers.length - 1].type === "esp" && layers[layers.length - 1].openingLump.includes(flipEspTag(str[i])) && (str[i] !== ">" || !xBeforeYOnTheRight$1(str, i + 1, ">", "<")) || str[i] === "-" && str[i + 1] === "-" && str[i + 2] === ">" && Array.isArray(layers) && layers.length && layers[layers.length - 1].type === "esp" && layers[layers.length - 1].openingLump[0] === "<" && layers[layers.length - 1].openingLump[2] === "-" && layers[layers.length - 1].openingLump[3] === "-";
return res;
}
......@@ -3388,11 +3390,9 @@
return layers.length && layers[layers.length - 1].type === "at" && isObj$2(layers[layers.length - 1].token) && Number.isInteger(layers[layers.length - 1].token.openingCurlyAt) && !Number.isInteger(layers[layers.length - 1].token.closingCurlyAt);
}
function initToken(type, startVal) {
attribReset();
function getNewToken(type, startVal = null) {
if (type === "tag") {
token = {
return {
type,
start: startVal,
end: null,
......@@ -3407,8 +3407,10 @@
kind: null,
attribs: []
};
} else if (type === "comment") {
token = {
}
if (type === "comment") {
return {
type,
start: startVal,
end: null,
......@@ -3416,8 +3418,10 @@
closing: false,
kind: "simple"
};
} else if (type === "rule") {
token = {
}
if (type === "rule") {
return {
type,
start: startVal,
end: null,
......@@ -3428,8 +3432,10 @@
selectorsEnd: null,
selectors: []
};
} else if (type === "at") {
token = {
}
if (type === "at") {
return {
type,
start: startVal,
end: null,
......@@ -3443,15 +3449,19 @@
queryStartsAt: null,
queryEndsAt: null
};
} else if (type === "text") {
token = {
}
if (type === "text") {
return {
type,
start: startVal,
end: null,
value: null
};
} else if (type === "esp") {
token = {
}
if (type === "esp") {
return {
type,
start: startVal,
end: null,
......@@ -3466,6 +3476,11 @@
}
}
function initToken(type, startVal) {
attribReset();
token = getNewToken(type, startVal);
}
for (let i = 0; i <= len; i++) {
if (!doNothing && str[i] && opts.reportProgressFunc) {
if (len > 1000 && len < 2000) {
......@@ -3693,8 +3708,9 @@
} else if (startsEsp(str, i, token, layers, styleStarts) && (!Array.isArray(layers) || !layers.length || layers[layers.length - 1].type !== "simple" || ![`'`, `"`].includes(layers[layers.length - 1].value) || attrib && attrib.attribStart && !attrib.attribEnd)) {
const wholeEspTagLumpOnTheRight = getWholeEspTagLumpOnTheRight(str, i, layers);
if (!espLumpBlacklist.includes(wholeEspTagLumpOnTheRight) && (!Array.isArray(layers) || !layers.length || layers[layers.length - 1].type !== "simple" || layers[layers.length - 1].value !== str[i + wholeEspTagLumpOnTheRight.length])) {
if (!espLumpBlacklist.includes(wholeEspTagLumpOnTheRight)) {
let lengthOfClosingEspChunk;
let disposableVar;
if (layers.length && (lengthOfClosingEspChunk = matchLayerLast(wholeEspTagLumpOnTheRight, layers))) {
if (token.type === "esp") {
......@@ -3745,6 +3761,23 @@
}
layers = [];
} else if (attrib && attrib.attribValue && attrib.attribValue.length && Array.from(str.slice(attrib.attribValue[attrib.attribValue.length - 1].start, i)).some((char, idx) => wholeEspTagLumpOnTheRight.includes(flipEspTag(char)) && (veryEspChars.includes(char) || !idx) && (disposableVar = {
char,
idx
})) && token.type === "tag" && attrib && attrib.attribValueStartsAt && !attrib.attribValueEndsAt && attrib.attribValue[attrib.attribValue.length - 1] && attrib.attribValue[attrib.attribValue.length - 1].type === "text") {
token.pureHTML = false;
const lastAttrValueObj = attrib.attribValue[attrib.attribValue.length - 1];
const newTokenToPutInstead = getNewToken("esp", lastAttrValueObj.start);
if (!disposableVar || !disposableVar.idx) {
newTokenToPutInstead.head = disposableVar.char;
newTokenToPutInstead.headStartsAt = lastAttrValueObj.start;
newTokenToPutInstead.headEndsAt = newTokenToPutInstead.headStartsAt + 1;
newTokenToPutInstead.tailStartsAt = i;
newTokenToPutInstead.tailEndsAt = i + wholeEspTagLumpOnTheRight.length;
newTokenToPutInstead.tail = wholeEspTagLumpOnTheRight;
attrib.attribValue[attrib.attribValue.length - 1] = newTokenToPutInstead;
}
} else {
if (Array.isArray(layers) && layers.length && layers[layers.length - 1].type === "esp") {
layers.pop();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -55,7 +55,7 @@ This package has three builds in `dist/` folder:
| ------------------------------------------------------------------------------------------------------- | --------------------- | -------------------------------- | ----- |
| Main export - **CommonJS version**, transpiled to ES5, contains `require` and `module.exports` | `main` | `dist/html-table-patcher.cjs.js` | 8 KB |
| **ES module** build that Webpack/Rollup understands. Untranspiled ES6 code with `import`/`export`. | `module` | `dist/html-table-patcher.esm.js` | 6 KB |
| **UMD build** for browsers, transpiled, minified, containing `iife`'s and has all dependencies baked-in | `browser` | `dist/html-table-patcher.umd.js` | 85 KB |
| **UMD build** for browsers, transpiled, minified, containing `iife`'s and has all dependencies baked-in | `browser` | `dist/html-table-patcher.umd.js` | 86 KB |
**[⬆ back to top](#)**
......
......@@ -3030,8 +3030,10 @@
*/
const allHTMLTagsKnownToHumanity = ["a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "command", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "isindex", "kbd", "keygen", "label", "legend", "li", "link", "listing", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "multicol", "nav", "nextid", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp"];
const espChars = `{}%-$_()*|#`;
const espLumpBlacklist = [")|(", "|(", ")(", "()", "{}", "%)", "*)", "**"];
const punctuationChars = [".", ",", ";", "!", "?"];
const veryEspChars = `{}()|#`;
const notVeryEspChars = `%$_*#`;
const espLumpBlacklist = [")|(", "|(", ")(", "()", "}{", "{}", "%)", "*)"];
const punctuationChars = `.,;!?`;
function isStr$3(something) {
return typeof something === "string";
......@@ -3183,7 +3185,7 @@
}
function startsEsp(str, i, token, layers, styleStarts) {
const res = espChars.includes(str[i]) && str[i + 1] && espChars.includes(str[i + 1]) && token.type !== "rule" && token.type !== "at" && !(str[i] === "-" && "-{(".includes(str[i + 1])) && !("})".includes(str[i]) && "-".includes(str[i + 1])) && !(str[i] === "%" && str[i + 1] === "%" && "0123456789".includes(str[i - 1]) && (!str[i + 2] || punctuationChars.includes(str[i + 2]) || !str[i + 2].trim().length)) && !(styleStarts && ("{}".includes(str[i]) || "{}".includes(str[right(str, i)]))) || str[i] === "<" && (str[i + 1] === "/" && espChars.includes(str[i + 2]) || espChars.includes(str[i + 1]) && !["-"].includes(str[i + 1])) || `>})`.includes(str[i]) && Array.isArray(layers) && layers.length && layers[layers.length - 1].type === "esp" && layers[layers.length - 1].openingLump.includes(flipEspTag(str[i])) && (str[i] !== ">" || !xBeforeYOnTheRight$1(str, i + 1, ">", "<")) || str[i] === "-" && str[i + 1] === "-" && str[i + 2] === ">" && Array.isArray(layers) && layers.length && layers[layers.length - 1].type === "esp" && layers[layers.length - 1].openingLump[0] === "<" && layers[layers.length - 1].openingLump[2] === "-" && layers[layers.length - 1].openingLump[3] === "-";
const res = espChars.includes(str[i]) && str[i + 1] && espChars.includes(str[i + 1]) && !(notVeryEspChars.includes(str[i]) && notVeryEspChars.includes(str[i + 1])) && (str[i] !== str[i + 1] || veryEspChars.includes(str[i])) && token.type !== "rule" && token.type !== "at" && !(str[i] === "-" && "-{(".includes(str[i + 1])) && !("})".includes(str[i]) && "-".includes(str[i + 1])) && !(str[i] === "%" && str[i + 1] === "%" && "0123456789".includes(str[i - 1]) && (!str[i + 2] || punctuationChars.includes(str[i + 2]) || !str[i + 2].trim().length)) && !(styleStarts && ("{}".includes(str[i]) || "{}".includes(str[right(str, i)]))) || str[i] === "<" && (str[i + 1] === "/" && espChars.includes(str[i + 2]) || espChars.includes(str[i + 1]) && !["-"].includes(str[i + 1])) || `>})`.includes(str[i]) && Array.isArray(layers) && layers.length && layers[layers.length - 1].type === "esp" && layers[layers.length - 1].openingLump.includes(flipEspTag(str[i])) && (str[i] !== ">" || !xBeforeYOnTheRight$1(str, i + 1, ">", "<")) || str[i] === "-" && str[i + 1] === "-" && str[i + 2] === ">" && Array.isArray(layers) && layers.length && layers[layers.length - 1].type === "esp" && layers[layers.length - 1].openingLump[0] === "<" && layers[layers.length - 1].openingLump[2] === "-" && layers[layers.length - 1].openingLump[3] === "-";
return res;
}
......@@ -3388,11 +3390,9 @@
return layers.length && layers[layers.length - 1].type === "at" && isObj$2(layers[layers.length - 1].token) && Number.isInteger(layers[layers.length - 1].token.openingCurlyAt) && !Number.isInteger(layers[layers.length - 1].token.closingCurlyAt);
}
function initToken(type, startVal) {
attribReset();
function getNewToken(type, startVal = null) {
if (type === "tag") {
token = {
return {
type,
start: startVal,
end: null,
......@@ -3407,8 +3407,10 @@
kind: null,
attribs: []
};
} else if (type === "comment") {
token = {
}
if (type === "comment") {
return {
type,
start: startVal,
end: null,
......@@ -3416,8 +3418,10 @@
closing: false,
kind: "simple"
};
} else if (type === "rule") {
token = {
}
if (type === "rule") {
return {
type,
start: startVal,
end: null,
......@@ -3428,8 +3432,10 @@
selectorsEnd: null,
selectors: []
};
} else if (type === "at") {
token = {
}
if (type === "at") {
return {
type,
start: startVal,
end: null,
......@@ -3443,15 +3449,19 @@
queryStartsAt: null,
queryEndsAt: null
};
} else if (type === "text") {
token = {
}
if (type === "text") {
return {
type,
start: startVal,
end: null,
value: null
};
} else if (type === "esp") {
token = {
}
if (type === "esp") {
return {
type,
start: startVal,
end: null,
......@@ -3466,6 +3476,11 @@
}
}
function initToken(type, startVal) {
attribReset();
token = getNewToken(type, startVal);
}
for (let i = 0; i <= len; i++) {
if (!doNothing && str[i] && opts.reportProgressFunc) {
if (len > 1000 && len < 2000) {
......@@ -3693,8 +3708,9 @@
} else if (startsEsp(str, i, token, layers, styleStarts) && (!Array.isArray(layers) || !layers.length || layers[layers.length - 1].type !== "simple" || ![`'`, `"`].includes(layers[layers.length - 1].value) || attrib && attrib.attribStart && !attrib.attribEnd)) {
const wholeEspTagLumpOnTheRight = getWholeEspTagLumpOnTheRight(str, i, layers);
if (!espLumpBlacklist.includes(wholeEspTagLumpOnTheRight) && (!Array.isArray(layers) || !layers.length || layers[layers.length - 1].type !== "simple" || layers[layers.length - 1].value !== str[i + wholeEspTagLumpOnTheRight.length])) {
if (!espLumpBlacklist.includes(wholeEspTagLumpOnTheRight)) {
let lengthOfClosingEspChunk;
let disposableVar;
if (layers.length && (lengthOfClosingEspChunk = matchLayerLast(wholeEspTagLumpOnTheRight, layers))) {
if (token.type === "esp") {
......@@ -3745,6 +3761,23 @@
}
layers = [];
} else if (attrib && attrib.attribValue && attrib.attribValue.length && Array.from(str.slice(attrib.attribValue[attrib.attribValue.length - 1].start, i)).some((char, idx) => wholeEspTagLumpOnTheRight.includes(flipEspTag(char)) && (veryEspChars.includes(char) || !idx) && (disposableVar = {
char,
idx
})) && token.type === "tag" && attrib && attrib.attribValueStartsAt && !attrib.attribValueEndsAt && attrib.attribValue[attrib.attribValue.length - 1] && attrib.attribValue[attrib.attribValue.length - 1].type === "text") {
token.pureHTML = false;
const lastAttrValueObj = attrib.attribValue[attrib.attribValue.length - 1];
const newTokenToPutInstead = getNewToken("esp", lastAttrValueObj.start);
if (!disposableVar || !disposableVar.idx) {
newTokenToPutInstead.head = disposableVar.char;
newTokenToPutInstead.headStartsAt = lastAttrValueObj.start;
newTokenToPutInstead.headEndsAt = newTokenToPutInstead.headStartsAt + 1;
newTokenToPutInstead.tailStartsAt = i;
newTokenToPutInstead.tailEndsAt = i + wholeEspTagLumpOnTheRight.length;
newTokenToPutInstead.tail = wholeEspTagLumpOnTheRight;
attrib.attribValue[attrib.attribValue.length - 1] = newTokenToPutInstead;
}
} else {
if (Array.isArray(layers) && layers.length && layers[layers.length - 1].type === "esp") {
layers.pop();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -22,6 +22,5 @@ test
.babelrc
.npmignore
.prettierignore
ideas.md
rollup.config.js
testStats.md
{
"all": {
"all-named-html-entities": 2680,
"all-named-html-entities": 4678,
"array-group-str-omit-num-char": 40,
"array-includes-with-glob": 39,
"array-of-arrays-into-ast": 10,
"array-of-arrays-sort-by-col": 785,
"array-of-arrays-sort-by-col": 794,
"array-pull-all-with-glob": 47,
"arrayiffy-if-string": 8,
"ast-compare": 229,
......@@ -24,29 +24,28 @@
"check-types-mini": 195,
"chlu": 180,
"chlu-cli": 5,
"codsen-parser": 89,
"codsen-parser": 96,
"codsen-tokenizer": 410,
"color-shorthand-hex-to-six-digit": 24,
"csv-sort": 24,
"csv-sort-cli": 4,
"csv-split-easy": 40,
"detect-is-it-html-or-xhtml": 50,
"detergent": 741597,
"easy-replace": 200,
"edit-package-json": 14029,
"detergent": 741598,
"easy-replace": 201,
"edit-package-json": 14030,
"email-all-chars-within-ascii": 56,
"email-all-chars-within-ascii-cli": 11,
"email-comb": 369,
"email-comb": 371,
"email-homey": 9,
"emlint": 4166,
"eslint-plugin-row-num": 17,
"eslint-plugin-test-num": 36,
"generate-atomic-css": 232,
"generate-atomic-css": 233,
"generate-atomic-css-cli": 4,
"gulp-email-remove-unused-css": 1,
"helga": 4,
"html-all-known-attributes": 3,
"html-crush": 540,
"html-crush": 539,
"html-entities-not-email-friendly": 5,
"html-img-alt": 214,
"html-table-patcher": 33,
......@@ -59,9 +58,9 @@
"js-row-num": 80,
"js-row-num-cli": 10,
"json-comb": 10,
"json-comb-core": 165,
"json-comb-core": 166,
"json-sort-cli": 23,
"json-variables": 285,
"json-variables": 286,
"lect": 1,
"lerna-clean-changelogs": 12,
"lerna-clean-changelogs-cli": 10,
......@@ -91,13 +90,13 @@
"string-apostrophes": 93,
"string-character-is-astral-surrogate": 18,
"string-collapse-leading-whitespace": 140,
"string-collapse-white-space": 11545,
"string-collapse-white-space": 11546,
"string-convert-indexes": 55,
"string-extract-class-names": 441,
"string-extract-sass-vars": 26,
"string-find-heads-tails": 89,
"string-find-malformed": 18,
"string-fix-broken-named-entities": 6391,
"string-fix-broken-named-entities": 20265,
"string-left-right": 336,
"string-match-left-right": 562,
"string-overlap-one-on-another": 38,
......@@ -109,7 +108,7 @@
"string-split-by-whitespace": 26,
"string-strip-html": 479,
"string-trim-spaces-only": 62,
"string-uglify": 2507,
"string-uglify": 3717,
"string-unfancy": 10,
"tap-parse-string-to-object": 10,
"update-versions": 29,
......@@ -117,12 +116,12 @@
"util-nonempty": 14
},
"totalPackageCount": 115,
"totalAssertsCount": 795038,
"totalAssertsCount": 807978,
"minAssertsCount": 3,
"minAssertsName": "html-all-known-attributes",
"maxAssertsCount": 741597,
"maxAssertsCount": 741598,
"maxAssertsName": "detergent",
"assertsCountMedian": 50,
"assertsCountArithmeticMean": 6913,
"assertsCountGeometricMean": 65
"assertsCountMedian": 49.5,
"assertsCountArithmeticMean": 7026,
"assertsCountGeometricMean": 64
}
\ No newline at end of file
......@@ -181,6 +181,6 @@
],
[
"2020-05-17",
795038
807978
]
]
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment