Skip to content

Commit 597536f

Browse files
fix(html): keep an attribute name or list token spelling a foreign delimiter (#22018)
* fix(html): keep an attribute name or list token spelling a foreign delimiter A `{% … %}` statement written into a tag tokenizes as attribute names, and one written into a `class` as list tokens, so its delimiters repeat. Both the spec's duplicate-attribute drop and the token list's own fold then discard one, turning valid input into invalid template markup. Neither fold is wrong about the DOM, but both discard bytes webpack cannot read. `_isWordSpan` now asks whether a name or token is one HTML vocabulary spells, and a tag or list holding one that is not keeps every name it names: the tag is echoed from source rather than rebuilt, and the list is read as text rather than as the set the DOM reflects. The test is per tag and per list, not per token — one foreign token in `class="a {% if x %} a {% endif %}"` has to disqualify the whole list, or the repeated `a` inside the statement still goes. This stays spec-exact: re-parsing the echoed tag drops the repeat again, so Chrome reads the same attributes from input and output. Word-shaped names still fold — `<p a=1 a=2>` prints `<p a=1>`, `rel="preload preload"` prints `rel=preload`, `class="a b a"` prints `class="a b"`. `sortTokenLists` reads the same rule and no longer reorders a list holding a statement. The word test runs only for a tag that dropped a duplicate, and for a list only once a repeat is found, so the parse and print hot paths are unchanged. Refs #22013 * chore: teach cspell the tsc members README names `lint:spellcheck` reads every Markdown file in the repo, so the names #22006 added to the README fail it on `main` and on every branch off it. * test(cli): update the flags snapshot for the reworded schema description The CLI flags are derived from the schema and carry each option's description verbatim, so rewording `normalizeListAttributes` changes four lines of it.
1 parent ab04b83 commit 597536f

11 files changed

Lines changed: 186 additions & 26 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack": patch
3+
---
4+
5+
Keep an HTML attribute name or list token holding a foreign template delimiter.

‎cspell.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
"Guardable",
170170
"gurmukhi",
171171
"gzipping",
172+
"Haijie",
172173
"hanja",
173174
"hashable",
174175
"hashbang",
@@ -277,6 +278,7 @@
277278
"mycompany",
278279
"mylibrary",
279280
"mynamespace",
281+
"Natsu",
280282
"navigations",
281283
"Neue",
282284
"Nitin",
@@ -539,6 +541,8 @@
539541
"Xarray",
540542
"Xexports",
541543
"Xfactory",
544+
"Xiao",
545+
"xiaoxiaojx",
542546
"xlink",
543547
"Xmodule",
544548
"xrrggbb",

‎declarations/WebpackOptions.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2613,7 +2613,7 @@ export interface OptimizationMinimizeHtml {
26132613
*/
26142614
normalizeEnumeratedAttributes?: boolean;
26152615
/**
2616-
* Normalize a list-shaped attribute value: a space-separated token list (`class`, `rel`, `part`, …), a comma-separated one (`accept`, `sizes`, …), a `srcset` and the viewport `<meta content>`. On by default. Reordering a token list is `sortTokenLists`, which is separate and off by default.
2616+
* Normalize a list-shaped attribute value: a space-separated token list (`class`, `rel`, `part`, …), a comma-separated one (`accept`, `sizes`, …), a `srcset` and the viewport `<meta content>`. On by default. A list is read as the set the DOM reflects, so a repeat folds away, only where every token of it is a word: one holding a delimiter another language wrote a statement in is text, and keeps every token it names. Reordering a token list is `sortTokenLists`, which is separate and off by default.
26172617
* @since 5.110.0
26182618
*/
26192619
normalizeListAttributes?: boolean;

‎lib/html/syntax.js‎

Lines changed: 95 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4929,6 +4929,10 @@ let _attrCount = 0;
49294929
// (§13.2.6.4.4, §13.2.6.4.7). The merged names are not in the element's source
49304930
// open tag, so the printer rebuilds that tag instead of echoing it.
49314931
const _mergedAttrNodes = new Set();
4932+
// Attribute runs whose start tag dropped a duplicate name and spells one no
4933+
// HTML vocabulary does: the printer hands those back whole (see `_isWordSpan`).
4934+
/** @type {Set<number>} */
4935+
const _foreignSyntaxAttrRuns = new Set();
49324936
// A processing instruction's target; its data rides in `_nodeStrings` like a
49334937
// comment's. A map, since a second string column per node would cost more.
49344938
/** @type {Map<HtmlNodeRef, string>} */
@@ -5000,6 +5004,32 @@ const _allocAttr = (name, value, nameStart, nameEnd, valueStart, valueEnd) => {
50005004
return i;
50015005
};
50025006

5007+
/**
5008+
* Whether a span reads as HTML vocabulary rather than as another language's
5009+
* text: an attribute name or list token starts with an ASCII letter, `_` or
5010+
* `-`, and no delimiter a template engine wraps a statement in appears in it.
5011+
* @param {string} text the string holding the span
5012+
* @param {number} start first index
5013+
* @param {number} end index after the last
5014+
* @returns {boolean} true when the span is a word
5015+
*/
5016+
const _isWordSpan = (text, start, end) => {
5017+
const first = text.charCodeAt(start);
5018+
if (
5019+
!(first >= 0x61 && first <= 0x7a) &&
5020+
!(first >= 0x41 && first <= 0x5a) &&
5021+
first !== 0x5f &&
5022+
first !== 0x2d
5023+
) {
5024+
return false;
5025+
}
5026+
for (let i = start + 1; i < end; i++) {
5027+
const c = text.charCodeAt(i);
5028+
if (c === 0x7b || c === 0x7d || c === 0x3c || c === 0x3e) return false;
5029+
}
5030+
return true;
5031+
};
5032+
50035033
/** @type {(i: number) => string} */
50045034
const _attrValueOf = (i) => {
50055035
const v = _attrValues[i];
@@ -5123,6 +5153,7 @@ const _resetAstColumns = () => {
51235153
_nodeHighWater = 0;
51245154
_attrCount = 0;
51255155
_mergedAttrNodes.clear();
5156+
_foreignSyntaxAttrRuns.clear();
51265157
_piTargets.clear();
51275158
_doctypePublicId = null;
51285159
_doctypeSystemId = null;
@@ -5167,6 +5198,7 @@ const _releaseAstColumns = () => {
51675198
_nodeHighWater = 0;
51685199
_attrCount = 0;
51695200
_mergedAttrNodes.clear();
5201+
_foreignSyntaxAttrRuns.clear();
51705202
_piTargets.clear();
51715203
_htmlSource = "";
51725204
_doctypePublicId = null;
@@ -5962,6 +5994,9 @@ let head = 0;
59625994
let form = 0;
59635995
let framesetOk = true;
59645996
let pendAttrStart = 0;
5997+
// Whether §13.2.5.33 dropped a repeated name from the tag being read; a tag
5998+
// that dropped none needs no word test, keeping it off the per-attribute path.
5999+
let pendAttrDropped = false;
59656000
let fosterParenting = false;
59666001
/** @type {number[]} */
59676002
const templateModes = [];
@@ -8536,7 +8571,10 @@ const handleAttributeToken = (
85368571
quoteType
85378572
) => {
85388573
const name = internLowerName(ATTR_NAME_INTERN, input, nameStart, nameEnd);
8539-
if (pendAttrStart === 0) pendAttrStart = _attrCount + 1;
8574+
if (pendAttrStart === 0) {
8575+
pendAttrStart = _attrCount + 1;
8576+
pendAttrDropped = false;
8577+
}
85408578
// Drop duplicate attribute names (per spec). Plain loop avoids a
85418579
// per-attribute closure allocation on this hot path.
85428580
let dup = false;
@@ -8546,6 +8584,7 @@ const handleAttributeToken = (
85468584
break;
85478585
}
85488586
}
8587+
if (dup) pendAttrDropped = true;
85498588
if (!dup) {
85508589
// The raw (undecoded) value is read from the source by offset on
85518590
// demand: consumers re-resolve requests from it and the offsets must
@@ -8590,6 +8629,16 @@ const handleStartTagToken = (
85908629
// `t.attrs` runs synchronously within this dispatch.
85918630
tok.attrs.start = pendAttrStart;
85928631
tok.attrs.count = pendAttrStart === 0 ? 0 : _attrCount + 1 - pendAttrStart;
8632+
// Only a name the run kept is tested: a dropped one repeats one of them.
8633+
if (pendAttrDropped) {
8634+
for (let i = pendAttrStart; i <= _attrCount; i++) {
8635+
const attributeName = _attrNames[i];
8636+
if (!_isWordSpan(attributeName, 0, attributeName.length)) {
8637+
_foreignSyntaxAttrRuns.add(pendAttrStart);
8638+
break;
8639+
}
8640+
}
8641+
}
85938642
pendAttrStart = 0;
85948643
tok.selfClosing = selfClosing;
85958644
tok.swallowNewline = false;
@@ -10112,17 +10161,33 @@ const _repeatsAToken = (list) => {
1011210161
return false;
1011310162
};
1011410163

10164+
/**
10165+
* Whether every token of a collapsed list is a word, which is what makes the
10166+
* list the set the DOM reflects rather than another language's text.
10167+
* @param {string} list a collapsed, trimmed token list
10168+
* @returns {boolean} true when no token holds a foreign delimiter
10169+
*/
10170+
const _tokensAreWords = (list) => {
10171+
const length = list.length;
10172+
for (let start = 0; start < length;) {
10173+
let end = list.indexOf(" ", start);
10174+
if (end === -1) end = length;
10175+
if (!_isWordSpan(list, start, end)) return false;
10176+
start = end + 1;
10177+
}
10178+
return true;
10179+
};
10180+
1011510181
/**
1011610182
* Collapse an ASCII-whitespace-separated token list (`class`) to single spaces,
10117-
* and — where the DOM reflects the list as a `DOMTokenList`, an ordered *set*,
10118-
* so a repeat was never a second token — drop a token already in it. Order is
10119-
* kept either way: the first spelling of each token stays put.
10183+
* and — where every token is a word, so the list is the ordered *set* the DOM
10184+
* reflects — drop a token already in it. Order is kept unless `sort` asks.
1012010185
* @param {string} raw raw (undecoded) value
10121-
* @param {boolean} unique whether a repeated token may go (`DOM_TOKEN_LIST_ATTRIBUTES`)
10186+
* @param {boolean} isSet whether the DOM reflects the list as a `DOMTokenList`
1012210187
* @param {boolean} sort whether to print the tokens in order (`sortTokenLists`)
1012310188
* @returns {string} the collapsed list
1012410189
*/
10125-
const _normalizeTokenList = (raw, unique, sort) => {
10190+
const _normalizeTokenList = (raw, isSet, sort) => {
1012610191
// One walk answers "already collapsed?" — the common already-minified list
1012710192
// rewrites nothing, so it must not pay the trim + regex replace either.
1012810193
let dirty = false;
@@ -10147,12 +10212,16 @@ const _normalizeTokenList = (raw, unique, sort) => {
1014710212
if (!dirty && previousSpace && raw.length !== 0) dirty = true;
1014810213
const collapsed = dirty ? _asciiTrim(raw).replace(/[\t\n\f\r ]+/g, " ") : raw;
1014910214
if (dirty ? !collapsed.includes(" ") : !hasSpace) return collapsed;
10215+
if (!isSet) return collapsed;
1015010216
// Cutting the list into tokens is the allocation this runs often enough to
10151-
// care about, and almost no list repeats one — so the check reads the spans
10152-
// in place and only a list that does pay for the pieces. Sorting needs them
10153-
// either way.
10154-
if (!sort && !(unique && _repeatsAToken(collapsed))) return collapsed;
10155-
if (sort) return _sortedTokenList(collapsed, unique);
10217+
// care about, and almost no list repeats one — so the checks read the spans
10218+
// in place and only a list that folds pays for the pieces.
10219+
if (sort) {
10220+
return _tokensAreWords(collapsed) ? _sortedTokenList(collapsed) : collapsed;
10221+
}
10222+
if (!_repeatsAToken(collapsed) || !_tokensAreWords(collapsed)) {
10223+
return collapsed;
10224+
}
1015610225
return [...new Set(collapsed.split(" "))].join(" ");
1015710226
};
1015810227

@@ -10183,13 +10252,12 @@ const _compareTokens = (list, aStart, aEnd, bStart, bEnd) => {
1018310252
};
1018410253

1018510254
/**
10186-
* `collapsed`'s tokens in sorted order, deduplicated when it is a set. They are
10187-
* ordered where they sit, so the pieces `split` would build are never built.
10255+
* `collapsed`'s tokens in sorted order, with a repeat dropped. They are ordered
10256+
* where they sit, so the pieces `split` would build are never built.
1018810257
* @param {string} collapsed a single-space-separated list
10189-
* @param {boolean} unique whether repeats collapse
10190-
* @returns {string} the ordered list
10258+
* @returns {string} the ordered set
1019110259
*/
10192-
const _sortedTokenList = (collapsed, unique) => {
10260+
const _sortedTokenList = (collapsed) => {
1019310261
const starts = _tokenSpanStarts;
1019410262
const ends = _tokenSpanEnds;
1019510263
let count = 0;
@@ -10221,7 +10289,6 @@ const _sortedTokenList = (collapsed, unique) => {
1022110289
let out = "";
1022210290
for (let i = 0; i < count; i++) {
1022310291
if (
10224-
unique &&
1022510292
i !== 0 &&
1022610293
_compareTokens(
1022710294
collapsed,
@@ -10325,8 +10392,8 @@ const _rewriteAttributeValue = (element, name, raw, viewport, enumeratedOn) => {
1032510392
(tokenListOn === null || tokenListOn.has(element))
1032610393
) {
1032710394
// Only the lists the DOM reflects as a `DOMTokenList` are sets, so only
10328-
// they may be reordered — `ping` is the order its requests go out in and
10329-
// `accesskey` the order its keys are tried.
10395+
// they may be reordered or have a repeat folded away — `ping` is the order
10396+
// its requests go out in and `accesskey` the order its keys are tried.
1033010397
const isSet = DOM_TOKEN_LIST_ATTRIBUTES.has(name);
1033110398
return _normalizeTokenList(raw, isSet, _sortTokenLists && isSet);
1033210399
}
@@ -10952,6 +11019,15 @@ const _minifyOpenTag = (path, open) => {
1095211019
// content keeps its source bytes: SVG admits element names no adjustment table
1095311020
// would case-correct on the way back in.
1095411021
const html = path.namespace() === NS_HTML;
11022+
// Rebuilding a tag another language wrote would print the spec's duplicate
11023+
// drop into the output, which a re-parse of the source makes again anyway.
11024+
if (
11025+
count !== 0 &&
11026+
_foreignSyntaxAttrRuns.size !== 0 &&
11027+
_foreignSyntaxAttrRuns.has(path.attributeAt(0))
11028+
) {
11029+
return open;
11030+
}
1095511031
const nameEnd = path.nameEnd() - tagStart;
1095611032
// A bare `<name>` — half of all tags — is what the rest would rebuild byte
1095711033
// for byte; decided before the name is sliced, so it allocates nothing.

‎schemas/WebpackOptions.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4205,7 +4205,7 @@
42054205
"added": "5.110.0"
42064206
},
42074207
"normalizeListAttributes": {
4208-
"description": "Normalize a list-shaped attribute value: a space-separated token list (`class`, `rel`, `part`, …), a comma-separated one (`accept`, `sizes`, …), a `srcset` and the viewport `<meta content>`. On by default. Reordering a token list is `sortTokenLists`, which is separate and off by default.",
4208+
"description": "Normalize a list-shaped attribute value: a space-separated token list (`class`, `rel`, `part`, …), a comma-separated one (`accept`, `sizes`, …), a `srcset` and the viewport `<meta content>`. On by default. A list is read as the set the DOM reflects, so a repeat folds away, only where every token of it is a word: one holding a delimiter another language wrote a statement in is text, and keeps every token it names. Reordering a token list is `sortTokenLists`, which is separate and off by default.",
42094209
"type": "boolean",
42104210
"added": "5.110.0"
42114211
},

‎test/HtmlSyntax.unittest.js‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5445,6 +5445,44 @@ describe("SourceProcessor — attribute quote spelling", () => {
54455445
});
54465446
});
54475447

5448+
describe("SourceProcessor — a duplicate attribute name", () => {
5449+
const { SourceProcessor } = require("../lib/html/syntax");
5450+
5451+
/**
5452+
* @param {string} html input markup
5453+
* @returns {string} the minified serialization
5454+
*/
5455+
const minify = (html) =>
5456+
new SourceProcessor().process(html, { mode: "minify" }).code;
5457+
5458+
it("is dropped where every name of the tag is a word", () => {
5459+
expect(minify("<p a=1 a=2>x</p>")).toBe("<p a=1>x");
5460+
expect(minify('<p data-x="1" data-x="2">x</p>')).toBe("<p data-x=1>x");
5461+
expect(minify('<svg><rect x="1" x="2"/></svg>')).toBe(
5462+
"<svg><rect x=1 /></svg>"
5463+
);
5464+
});
5465+
5466+
it("is written back where the tag spells a foreign delimiter", () => {
5467+
// `{%` / `%}` tokenize as attribute names, so `{% endif %}` repeats both
5468+
// and §13.2.5.33 drops them; a re-parse of the echoed tag drops them again.
5469+
for (const tag of [
5470+
'<input type="text"{% if required %} required{% endif %}>',
5471+
"<div {{cond}} id=a id=b></div>",
5472+
"<div {{#if x}} data-a=1 {{/if}} data-a=2></div>"
5473+
]) {
5474+
expect(minify(tag)).toContain(tag);
5475+
}
5476+
});
5477+
5478+
it("leaves the tag its source spelling, quotes and all", () => {
5479+
// The whole tag is echoed, so nothing else of it is rewritten either.
5480+
expect(minify('<input TYPE="TEXT"{% if x %} a{% endif %}>')).toBe(
5481+
'<input TYPE="TEXT"{% if x %} a{% endif %}>'
5482+
);
5483+
});
5484+
});
5485+
54485486
describe("SourceProcessor — token list values", () => {
54495487
const { SourceProcessor } = require("../lib/html/syntax");
54505488

@@ -5484,6 +5522,22 @@ describe("SourceProcessor — token list values", () => {
54845522
);
54855523
expect(minify('<div accesskey="k k">x</div>')).toContain('accesskey="k k"');
54865524
});
5525+
5526+
it("reads a list holding a foreign delimiter as text, not as a set", () => {
5527+
// A `{% … %}` statement tokenizes as list tokens, so folding the repeated
5528+
// `%}` away would lose a delimiter the template needs.
5529+
for (const list of [
5530+
'class="btn{% if active %} btn-active{% endif %}"',
5531+
'class="a {{ if x }} a {{ endif }}"',
5532+
'rel="preload {{extra}} preload {{extra}}"'
5533+
]) {
5534+
expect(minify(`<link ${list} href=x>`)).toContain(list);
5535+
}
5536+
// The separators between them still collapse: that keeps every token.
5537+
expect(minify('<div class="btn{% if x %}">y</div>')).toContain(
5538+
'class="btn{% if x %}"'
5539+
);
5540+
});
54875541
});
54885542

54895543
describe("SourceProcessor — sortAttributes / sortTokenLists", () => {
@@ -5553,6 +5607,14 @@ describe("SourceProcessor — sortAttributes / sortTokenLists", () => {
55535607
);
55545608
});
55555609

5610+
it("leaves a list holding a foreign delimiter in its written order", () => {
5611+
// Sorting one would move the statements away from what they wrap.
5612+
const list = 'class="btn{% if active %} btn-active{% endif %}"';
5613+
expect(minify(`<div ${list}>x</div>`, { sortTokenLists: true })).toBe(
5614+
`<div ${list}>x</div>`
5615+
);
5616+
});
5617+
55565618
it("leaves foreign content alone, where a name is not case-folded", () => {
55575619
expect(
55585620
minify('<svg><rect zz="1" aa="2"/></svg>', { sortAttributes: true })

‎test/__snapshots__/Cli.basictest.js.snap‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11562,13 +11562,13 @@ Object {
1156211562
"optimization-minimize-html-normalize-list-attributes": Object {
1156311563
"configs": Array [
1156411564
Object {
11565-
"description": "Normalize a list-shaped attribute value: a space-separated token list (\`class\`, \`rel\`, \`part\`, …), a comma-separated one (\`accept\`, \`sizes\`, …), a \`srcset\` and the viewport \`<meta content>\`. On by default. Reordering a token list is \`sortTokenLists\`, which is separate and off by default.",
11565+
"description": "Normalize a list-shaped attribute value: a space-separated token list (\`class\`, \`rel\`, \`part\`, …), a comma-separated one (\`accept\`, \`sizes\`, …), a \`srcset\` and the viewport \`<meta content>\`. On by default. A list is read as the set the DOM reflects, so a repeat folds away, only where every token of it is a word: one holding a delimiter another language wrote a statement in is text, and keeps every token it names. Reordering a token list is \`sortTokenLists\`, which is separate and off by default.",
1156611566
"multiple": false,
1156711567
"path": "optimization.minimize.html.normalizeListAttributes",
1156811568
"type": "boolean",
1156911569
},
1157011570
],
11571-
"description": "Normalize a list-shaped attribute value: a space-separated token list (\`class\`, \`rel\`, \`part\`, …), a comma-separated one (\`accept\`, \`sizes\`, …), a \`srcset\` and the viewport \`<meta content>\`. On by default. Reordering a token list is \`sortTokenLists\`, which is separate and off by default.",
11571+
"description": "Normalize a list-shaped attribute value: a space-separated token list (\`class\`, \`rel\`, \`part\`, …), a comma-separated one (\`accept\`, \`sizes\`, …), a \`srcset\` and the viewport \`<meta content>\`. On by default. A list is read as the set the DOM reflects, so a repeat folds away, only where every token of it is a word: one holding a delimiter another language wrote a statement in is text, and keeps every token it names. Reordering a token list is \`sortTokenLists\`, which is separate and off by default.",
1157211572
"multiple": false,
1157311573
"simpleType": "boolean",
1157411574
},
@@ -12227,13 +12227,13 @@ Object {
1222712227
"optimization-minimize-options-html-normalize-list-attributes": Object {
1222812228
"configs": Array [
1222912229
Object {
12230-
"description": "Normalize a list-shaped attribute value: a space-separated token list (\`class\`, \`rel\`, \`part\`, …), a comma-separated one (\`accept\`, \`sizes\`, …), a \`srcset\` and the viewport \`<meta content>\`. On by default. Reordering a token list is \`sortTokenLists\`, which is separate and off by default.",
12230+
"description": "Normalize a list-shaped attribute value: a space-separated token list (\`class\`, \`rel\`, \`part\`, …), a comma-separated one (\`accept\`, \`sizes\`, …), a \`srcset\` and the viewport \`<meta content>\`. On by default. A list is read as the set the DOM reflects, so a repeat folds away, only where every token of it is a word: one holding a delimiter another language wrote a statement in is text, and keeps every token it names. Reordering a token list is \`sortTokenLists\`, which is separate and off by default.",
1223112231
"multiple": false,
1223212232
"path": "optimization.minimizeOptions.html.normalizeListAttributes",
1223312233
"type": "boolean",
1223412234
},
1223512235
],
12236-
"description": "Normalize a list-shaped attribute value: a space-separated token list (\`class\`, \`rel\`, \`part\`, …), a comma-separated one (\`accept\`, \`sizes\`, …), a \`srcset\` and the viewport \`<meta content>\`. On by default. Reordering a token list is \`sortTokenLists\`, which is separate and off by default.",
12236+
"description": "Normalize a list-shaped attribute value: a space-separated token list (\`class\`, \`rel\`, \`part\`, …), a comma-separated one (\`accept\`, \`sizes\`, …), a \`srcset\` and the viewport \`<meta content>\`. On by default. A list is read as the set the DOM reflects, so a repeat folds away, only where every token of it is a word: one holding a delimiter another language wrote a statement in is text, and keeps every token it names. Reordering a token list is \`sortTokenLists\`, which is separate and off by default.",
1223712237
"multiple": false,
1223812238
"simpleType": "boolean",
1223912239
},

‎test/configCases/html/minimize-attributes/__snapshots__/ConfigCacheTest.snap‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ b\\">newline in a value</p>
3030
<svg viewBox=\\"0 0 8 8\\"><rect x=1 y=2 /><circle R=1 /></svg>
3131
<div class=a>source casing</div>
3232
<p a=1>duplicate attribute</p>
33+
<p class=\\"a b\\">repeated class token, folded</p>
34+
35+
<input type=\\"text\\"{% if required %} required{% endif %}>
36+
<p class=\\"btn{% if active %} btn-active{% endif %}\\">the same list, as text</p>
3337
<p data-slash=/end/>value ending in a slash</p>
3438
<a href=x/>unquoted value ending in a slash</a>
3539
<pre> preformatted

0 commit comments

Comments
 (0)