@scalar/code-highlight 0.4.10 → 0.4.12
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 +19 -0
- package/dist/chunks/code.js +1 -1
- package/dist/chunks/code.js.map +1 -1
- package/dist/chunks/languages.js +11996 -11869
- package/dist/chunks/languages.js.map +1 -1
- package/dist/chunks/lib.js.map +1 -1
- package/dist/chunks/markdown.js +76 -59
- package/dist/chunks/markdown.js.map +1 -1
- package/dist/chunks/rehype-highlight.js +9 -8
- package/dist/chunks/rehype-highlight.js.map +1 -1
- package/dist/chunks/shared-lowlight.js +135 -163
- package/dist/chunks/shared-lowlight.js.map +1 -1
- package/dist/code/index.js +1 -2
- package/dist/css/code.css +5 -1
- package/dist/index.js +1 -1
- package/dist/languages/index.js +1 -2
- package/dist/markdown/index.js +1 -2
- package/dist/rehype-alert/index.js +1 -2
- package/dist/rehype-highlight/index.js +1 -2
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as __exportAll, l as __toESM, n as createLowlight, s as __commonJSMin } from "./rehype-highlight.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
2
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/schema.js
|
|
3
3
|
/**
|
|
4
4
|
* @import {Schema as SchemaType, Space} from 'property-information'
|
|
5
5
|
*/
|
|
@@ -25,7 +25,7 @@ Schema.prototype.normal = {};
|
|
|
25
25
|
Schema.prototype.property = {};
|
|
26
26
|
Schema.prototype.space = void 0;
|
|
27
27
|
//#endregion
|
|
28
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
28
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/merge.js
|
|
29
29
|
/**
|
|
30
30
|
* @import {Info, Space} from 'property-information'
|
|
31
31
|
*/
|
|
@@ -49,7 +49,7 @@ function merge(definitions, space) {
|
|
|
49
49
|
return new Schema(property, normal, space);
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
52
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
52
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/normalize.js
|
|
53
53
|
/**
|
|
54
54
|
* Get the cleaned case insensitive form of an attribute or property.
|
|
55
55
|
*
|
|
@@ -63,7 +63,7 @@ function normalize$1(value) {
|
|
|
63
63
|
return value.toLowerCase();
|
|
64
64
|
}
|
|
65
65
|
//#endregion
|
|
66
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
66
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/info.js
|
|
67
67
|
/**
|
|
68
68
|
* @import {Info as InfoType} from 'property-information'
|
|
69
69
|
*/
|
|
@@ -95,7 +95,7 @@ Info.prototype.property = "";
|
|
|
95
95
|
Info.prototype.spaceSeparated = false;
|
|
96
96
|
Info.prototype.space = void 0;
|
|
97
97
|
//#endregion
|
|
98
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
98
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/types.js
|
|
99
99
|
var types_exports = /* @__PURE__ */ __exportAll({
|
|
100
100
|
boolean: () => boolean,
|
|
101
101
|
booleanish: () => booleanish,
|
|
@@ -117,7 +117,7 @@ function increment() {
|
|
|
117
117
|
return 2 ** ++powers;
|
|
118
118
|
}
|
|
119
119
|
//#endregion
|
|
120
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
120
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/defined-info.js
|
|
121
121
|
/**
|
|
122
122
|
* @import {Space} from 'property-information'
|
|
123
123
|
*/
|
|
@@ -163,7 +163,7 @@ function mark(values, key, value) {
|
|
|
163
163
|
if (value) values[key] = value;
|
|
164
164
|
}
|
|
165
165
|
//#endregion
|
|
166
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
166
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/create.js
|
|
167
167
|
/**
|
|
168
168
|
* @import {Info, Space} from 'property-information'
|
|
169
169
|
*/
|
|
@@ -212,7 +212,7 @@ function create(definition) {
|
|
|
212
212
|
return new Schema(properties, normals, definition.space);
|
|
213
213
|
}
|
|
214
214
|
//#endregion
|
|
215
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
215
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/aria.js
|
|
216
216
|
var aria = create({
|
|
217
217
|
properties: {
|
|
218
218
|
ariaActiveDescendant: null,
|
|
@@ -270,7 +270,7 @@ var aria = create({
|
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
//#endregion
|
|
273
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
273
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-sensitive-transform.js
|
|
274
274
|
/**
|
|
275
275
|
* @param {Record<string, string>} attributes
|
|
276
276
|
* Attributes.
|
|
@@ -283,7 +283,7 @@ function caseSensitiveTransform(attributes, attribute) {
|
|
|
283
283
|
return attribute in attributes ? attributes[attribute] : attribute;
|
|
284
284
|
}
|
|
285
285
|
//#endregion
|
|
286
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
286
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-insensitive-transform.js
|
|
287
287
|
/**
|
|
288
288
|
* @param {Record<string, string>} attributes
|
|
289
289
|
* Attributes.
|
|
@@ -296,7 +296,7 @@ function caseInsensitiveTransform(attributes, property) {
|
|
|
296
296
|
return caseSensitiveTransform(attributes, property.toLowerCase());
|
|
297
297
|
}
|
|
298
298
|
//#endregion
|
|
299
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
299
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/html.js
|
|
300
300
|
var html$3 = create({
|
|
301
301
|
attributes: {
|
|
302
302
|
acceptcharset: "accept-charset",
|
|
@@ -320,6 +320,7 @@ var html$3 = create({
|
|
|
320
320
|
allowFullScreen: boolean,
|
|
321
321
|
allowPaymentRequest: boolean,
|
|
322
322
|
allowUserMedia: boolean,
|
|
323
|
+
alpha: boolean,
|
|
323
324
|
alt: null,
|
|
324
325
|
as: null,
|
|
325
326
|
async: boolean,
|
|
@@ -333,8 +334,12 @@ var html$3 = create({
|
|
|
333
334
|
checked: boolean,
|
|
334
335
|
cite: null,
|
|
335
336
|
className: spaceSeparated,
|
|
337
|
+
closedBy: null,
|
|
338
|
+
colorSpace: null,
|
|
336
339
|
cols: number,
|
|
337
|
-
colSpan:
|
|
340
|
+
colSpan: number,
|
|
341
|
+
command: null,
|
|
342
|
+
commandFor: null,
|
|
338
343
|
content: null,
|
|
339
344
|
contentEditable: booleanish,
|
|
340
345
|
controls: boolean,
|
|
@@ -514,8 +519,10 @@ var html$3 = create({
|
|
|
514
519
|
seamless: boolean,
|
|
515
520
|
selected: boolean,
|
|
516
521
|
shadowRootClonable: boolean,
|
|
522
|
+
shadowRootCustomElementRegistry: boolean,
|
|
517
523
|
shadowRootDelegatesFocus: boolean,
|
|
518
524
|
shadowRootMode: null,
|
|
525
|
+
shadowRootSerializable: boolean,
|
|
519
526
|
shape: null,
|
|
520
527
|
size: number,
|
|
521
528
|
sizes: null,
|
|
@@ -596,8 +603,11 @@ var html$3 = create({
|
|
|
596
603
|
allowTransparency: null,
|
|
597
604
|
autoCorrect: null,
|
|
598
605
|
autoSave: null,
|
|
606
|
+
credentialless: boolean,
|
|
599
607
|
disablePictureInPicture: boolean,
|
|
600
608
|
disableRemotePlayback: boolean,
|
|
609
|
+
exportParts: commaSeparated,
|
|
610
|
+
part: spaceSeparated,
|
|
601
611
|
prefix: null,
|
|
602
612
|
property: null,
|
|
603
613
|
results: number,
|
|
@@ -608,7 +618,7 @@ var html$3 = create({
|
|
|
608
618
|
transform: caseInsensitiveTransform
|
|
609
619
|
});
|
|
610
620
|
//#endregion
|
|
611
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
621
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/svg.js
|
|
612
622
|
var svg$1 = create({
|
|
613
623
|
attributes: {
|
|
614
624
|
accentHeight: "accent-height",
|
|
@@ -651,6 +661,7 @@ var svg$1 = create({
|
|
|
651
661
|
markerEnd: "marker-end",
|
|
652
662
|
markerMid: "marker-mid",
|
|
653
663
|
markerStart: "marker-start",
|
|
664
|
+
maskType: "mask-type",
|
|
654
665
|
navDown: "nav-down",
|
|
655
666
|
navDownLeft: "nav-down-left",
|
|
656
667
|
navDownRight: "nav-down-right",
|
|
@@ -917,6 +928,7 @@ var svg$1 = create({
|
|
|
917
928
|
markerWidth: null,
|
|
918
929
|
mask: null,
|
|
919
930
|
maskContentUnits: null,
|
|
931
|
+
maskType: null,
|
|
920
932
|
maskUnits: null,
|
|
921
933
|
mathematical: null,
|
|
922
934
|
max: null,
|
|
@@ -1166,7 +1178,7 @@ var svg$1 = create({
|
|
|
1166
1178
|
transform: caseSensitiveTransform
|
|
1167
1179
|
});
|
|
1168
1180
|
//#endregion
|
|
1169
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
1181
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xlink.js
|
|
1170
1182
|
var xlink = create({
|
|
1171
1183
|
properties: {
|
|
1172
1184
|
xLinkActuate: null,
|
|
@@ -1183,7 +1195,7 @@ var xlink = create({
|
|
|
1183
1195
|
}
|
|
1184
1196
|
});
|
|
1185
1197
|
//#endregion
|
|
1186
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
1198
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xmlns.js
|
|
1187
1199
|
var xmlns = create({
|
|
1188
1200
|
attributes: { xmlnsxlink: "xmlns:xlink" },
|
|
1189
1201
|
properties: {
|
|
@@ -1194,7 +1206,7 @@ var xmlns = create({
|
|
|
1194
1206
|
transform: caseInsensitiveTransform
|
|
1195
1207
|
});
|
|
1196
1208
|
//#endregion
|
|
1197
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
1209
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xml.js
|
|
1198
1210
|
var xml = create({
|
|
1199
1211
|
properties: {
|
|
1200
1212
|
xmlBase: null,
|
|
@@ -1207,7 +1219,7 @@ var xml = create({
|
|
|
1207
1219
|
}
|
|
1208
1220
|
});
|
|
1209
1221
|
//#endregion
|
|
1210
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
1222
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/find.js
|
|
1211
1223
|
/**
|
|
1212
1224
|
* @import {Schema} from 'property-information'
|
|
1213
1225
|
*/
|
|
@@ -1284,7 +1296,7 @@ function camelcase$1($0) {
|
|
|
1284
1296
|
return $0.charAt(1).toUpperCase();
|
|
1285
1297
|
}
|
|
1286
1298
|
//#endregion
|
|
1287
|
-
//#region ../../node_modules/.pnpm/property-information@7.
|
|
1299
|
+
//#region ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/index.js
|
|
1288
1300
|
var html$2 = merge([
|
|
1289
1301
|
aria,
|
|
1290
1302
|
html$3,
|
|
@@ -1611,16 +1623,20 @@ function addProperty(schema, properties, key, value) {
|
|
|
1611
1623
|
if (Number.isNaN(value)) return;
|
|
1612
1624
|
result = value;
|
|
1613
1625
|
} else if (typeof value === "boolean") result = value;
|
|
1614
|
-
else if (typeof value === "string")
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1626
|
+
else if (typeof value === "string") {
|
|
1627
|
+
if (info.spaceSeparated) result = parse$1(value);
|
|
1628
|
+
else if (info.commaSeparated) result = parse$2(value);
|
|
1629
|
+
else if (info.commaOrSpaceSeparated) result = parse$1(parse$2(value).join(" "));
|
|
1630
|
+
else result = parsePrimitive(info, info.property, value);
|
|
1631
|
+
} else if (Array.isArray(value)) result = value.concat();
|
|
1619
1632
|
else result = info.property === "style" ? style(value) : String(value);
|
|
1620
1633
|
if (Array.isArray(result)) {
|
|
1621
1634
|
/** @type {Array<number | string>} */
|
|
1622
1635
|
const finalResult = [];
|
|
1623
|
-
while (++index < result.length)
|
|
1636
|
+
while (++index < result.length) {
|
|
1637
|
+
const value = parsePrimitive(info, info.property, result[index]);
|
|
1638
|
+
finalResult[index] = value;
|
|
1639
|
+
}
|
|
1624
1640
|
result = finalResult;
|
|
1625
1641
|
}
|
|
1626
1642
|
if (info.property === "className" && Array.isArray(properties.className)) {
|
|
@@ -1644,9 +1660,10 @@ function addChild(nodes, value) {
|
|
|
1644
1660
|
value: String(value)
|
|
1645
1661
|
});
|
|
1646
1662
|
else if (Array.isArray(value)) while (++index < value.length) addChild(nodes, value[index]);
|
|
1647
|
-
else if (typeof value === "object" && "type" in value)
|
|
1648
|
-
|
|
1649
|
-
|
|
1663
|
+
else if (typeof value === "object" && "type" in value) {
|
|
1664
|
+
if (value.type === "root") addChild(nodes, value.children);
|
|
1665
|
+
else nodes.push(value);
|
|
1666
|
+
} else throw new Error("Expected node, nodes, or string, got `" + value + "`");
|
|
1650
1667
|
}
|
|
1651
1668
|
/**
|
|
1652
1669
|
* Parse a single primitives.
|
|
@@ -3758,9 +3775,7 @@ var Tokenizer = class {
|
|
|
3758
3775
|
case TokenType.NULL_CHARACTER:
|
|
3759
3776
|
this.handler.onNullCharacter(this.currentCharacterToken);
|
|
3760
3777
|
break;
|
|
3761
|
-
case TokenType.WHITESPACE_CHARACTER:
|
|
3762
|
-
this.handler.onWhitespaceCharacter(this.currentCharacterToken);
|
|
3763
|
-
break;
|
|
3778
|
+
case TokenType.WHITESPACE_CHARACTER: this.handler.onWhitespaceCharacter(this.currentCharacterToken);
|
|
3764
3779
|
}
|
|
3765
3780
|
this.currentCharacterToken = null;
|
|
3766
3781
|
}
|
|
@@ -3780,13 +3795,15 @@ var Tokenizer = class {
|
|
|
3780
3795
|
this.active = false;
|
|
3781
3796
|
}
|
|
3782
3797
|
_appendCharToCurrentCharacterToken(type, ch) {
|
|
3783
|
-
if (this.currentCharacterToken)
|
|
3784
|
-
this.currentCharacterToken.
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3798
|
+
if (this.currentCharacterToken) {
|
|
3799
|
+
if (this.currentCharacterToken.type === type) {
|
|
3800
|
+
this.currentCharacterToken.chars += ch;
|
|
3801
|
+
return;
|
|
3802
|
+
} else {
|
|
3803
|
+
this.currentLocation = this.getCurrentLocation(0);
|
|
3804
|
+
this._emitCurrentCharacterToken(this.currentLocation);
|
|
3805
|
+
this.preprocessor.dropParsedChunk();
|
|
3806
|
+
}
|
|
3790
3807
|
}
|
|
3791
3808
|
this._createCharacterToken(type, ch);
|
|
3792
3809
|
}
|
|
@@ -4762,14 +4779,15 @@ var Tokenizer = class {
|
|
|
4762
4779
|
} else if (this._consumeSequenceIfMatch(SEQUENCES.DOCTYPE, false)) {
|
|
4763
4780
|
this.currentLocation = this.getCurrentLocation(SEQUENCES.DOCTYPE.length + 1);
|
|
4764
4781
|
this.state = State.DOCTYPE;
|
|
4765
|
-
} else if (this._consumeSequenceIfMatch(SEQUENCES.CDATA_START, true))
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4782
|
+
} else if (this._consumeSequenceIfMatch(SEQUENCES.CDATA_START, true)) {
|
|
4783
|
+
if (this.inForeignNode) this.state = State.CDATA_SECTION;
|
|
4784
|
+
else {
|
|
4785
|
+
this._err(ERR.cdataInHtmlContent);
|
|
4786
|
+
this._createCommentToken(SEQUENCES.CDATA_START.length + 1);
|
|
4787
|
+
this.currentToken.data = "[CDATA[";
|
|
4788
|
+
this.state = State.BOGUS_COMMENT;
|
|
4789
|
+
}
|
|
4790
|
+
} else if (!this._ensureHibernation()) {
|
|
4773
4791
|
this._err(ERR.incorrectlyOpenedComment);
|
|
4774
4792
|
this._createCommentToken(2);
|
|
4775
4793
|
this.state = State.BOGUS_COMMENT;
|
|
@@ -5400,8 +5418,6 @@ var Tokenizer = class {
|
|
|
5400
5418
|
case CODE_POINTS.EOF:
|
|
5401
5419
|
this.emitCurrentDoctype(token);
|
|
5402
5420
|
this._emitEOFToken();
|
|
5403
|
-
break;
|
|
5404
|
-
default:
|
|
5405
5421
|
}
|
|
5406
5422
|
}
|
|
5407
5423
|
_stateCdataSection(cp) {
|
|
@@ -5440,13 +5456,15 @@ var Tokenizer = class {
|
|
|
5440
5456
|
}
|
|
5441
5457
|
_stateCharacterReference() {
|
|
5442
5458
|
let length = this.entityDecoder.write(this.preprocessor.html, this.preprocessor.pos);
|
|
5443
|
-
if (length < 0)
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5459
|
+
if (length < 0) {
|
|
5460
|
+
if (this.preprocessor.lastChunkWritten) length = this.entityDecoder.end();
|
|
5461
|
+
else {
|
|
5462
|
+
this.active = false;
|
|
5463
|
+
this.preprocessor.pos = this.preprocessor.html.length - 1;
|
|
5464
|
+
this.consumedAfterSnapshot = 0;
|
|
5465
|
+
this.preprocessor.endOfChunkHit = true;
|
|
5466
|
+
return;
|
|
5467
|
+
}
|
|
5450
5468
|
}
|
|
5451
5469
|
if (length === 0) {
|
|
5452
5470
|
this.preprocessor.pos = this.entityStartPos;
|
|
@@ -5642,13 +5660,15 @@ var OpenElementStack = class {
|
|
|
5642
5660
|
}
|
|
5643
5661
|
remove(element) {
|
|
5644
5662
|
const idx = this._indexOf(element);
|
|
5645
|
-
if (idx >= 0)
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5663
|
+
if (idx >= 0) {
|
|
5664
|
+
if (idx === this.stackTop) this.pop();
|
|
5665
|
+
else {
|
|
5666
|
+
this.items.splice(idx, 1);
|
|
5667
|
+
this.tagIDs.splice(idx, 1);
|
|
5668
|
+
this.stackTop--;
|
|
5669
|
+
this._updateCurrentElement();
|
|
5670
|
+
this.handler.onItemPop(element, false);
|
|
5671
|
+
}
|
|
5652
5672
|
}
|
|
5653
5673
|
}
|
|
5654
5674
|
tryPeekProperlyNestedBodyElement() {
|
|
@@ -5675,9 +5695,7 @@ var OpenElementStack = class {
|
|
|
5675
5695
|
case NS.SVG:
|
|
5676
5696
|
if (SCOPING_ELEMENTS_SVG.has(tn)) return false;
|
|
5677
5697
|
break;
|
|
5678
|
-
case NS.MATHML:
|
|
5679
|
-
if (SCOPING_ELEMENTS_MATHML.has(tn)) return false;
|
|
5680
|
-
break;
|
|
5698
|
+
case NS.MATHML: if (SCOPING_ELEMENTS_MATHML.has(tn)) return false;
|
|
5681
5699
|
}
|
|
5682
5700
|
}
|
|
5683
5701
|
return true;
|
|
@@ -5702,9 +5720,7 @@ var OpenElementStack = class {
|
|
|
5702
5720
|
case NS.SVG:
|
|
5703
5721
|
if (SCOPING_ELEMENTS_SVG.has(tn)) return false;
|
|
5704
5722
|
break;
|
|
5705
|
-
case NS.MATHML:
|
|
5706
|
-
if (SCOPING_ELEMENTS_MATHML.has(tn)) return false;
|
|
5707
|
-
break;
|
|
5723
|
+
case NS.MATHML: if (SCOPING_ELEMENTS_MATHML.has(tn)) return false;
|
|
5708
5724
|
}
|
|
5709
5725
|
}
|
|
5710
5726
|
return true;
|
|
@@ -6575,10 +6591,7 @@ var Parser = class {
|
|
|
6575
6591
|
case TAG_ID.SCRIPT:
|
|
6576
6592
|
this.tokenizer.state = TokenizerMode.SCRIPT_DATA;
|
|
6577
6593
|
break;
|
|
6578
|
-
case TAG_ID.PLAINTEXT:
|
|
6579
|
-
this.tokenizer.state = TokenizerMode.PLAINTEXT;
|
|
6580
|
-
break;
|
|
6581
|
-
default:
|
|
6594
|
+
case TAG_ID.PLAINTEXT: this.tokenizer.state = TokenizerMode.PLAINTEXT;
|
|
6582
6595
|
}
|
|
6583
6596
|
}
|
|
6584
6597
|
/** @protected */
|
|
@@ -6734,9 +6747,7 @@ var Parser = class {
|
|
|
6734
6747
|
case TokenType.EOF:
|
|
6735
6748
|
this.onEof(token);
|
|
6736
6749
|
break;
|
|
6737
|
-
case TokenType.WHITESPACE_CHARACTER:
|
|
6738
|
-
this.onWhitespaceCharacter(token);
|
|
6739
|
-
break;
|
|
6750
|
+
case TokenType.WHITESPACE_CHARACTER: this.onWhitespaceCharacter(token);
|
|
6740
6751
|
}
|
|
6741
6752
|
}
|
|
6742
6753
|
/** @protected */
|
|
@@ -6810,12 +6821,10 @@ var Parser = class {
|
|
|
6810
6821
|
return;
|
|
6811
6822
|
}
|
|
6812
6823
|
break;
|
|
6813
|
-
case TAG_ID.HEAD:
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
}
|
|
6818
|
-
break;
|
|
6824
|
+
case TAG_ID.HEAD: if (i > 0) {
|
|
6825
|
+
this.insertionMode = InsertionMode.IN_HEAD;
|
|
6826
|
+
return;
|
|
6827
|
+
}
|
|
6819
6828
|
}
|
|
6820
6829
|
this.insertionMode = InsertionMode.IN_BODY;
|
|
6821
6830
|
}
|
|
@@ -6861,7 +6870,6 @@ var Parser = class {
|
|
|
6861
6870
|
beforeElement: null
|
|
6862
6871
|
};
|
|
6863
6872
|
}
|
|
6864
|
-
default:
|
|
6865
6873
|
}
|
|
6866
6874
|
}
|
|
6867
6875
|
return {
|
|
@@ -6930,10 +6938,7 @@ var Parser = class {
|
|
|
6930
6938
|
case InsertionMode.AFTER_BODY:
|
|
6931
6939
|
tokenAfterBody(this, token);
|
|
6932
6940
|
break;
|
|
6933
|
-
case InsertionMode.AFTER_AFTER_BODY:
|
|
6934
|
-
tokenAfterAfterBody(this, token);
|
|
6935
|
-
break;
|
|
6936
|
-
default:
|
|
6941
|
+
case InsertionMode.AFTER_AFTER_BODY: tokenAfterAfterBody(this, token);
|
|
6937
6942
|
}
|
|
6938
6943
|
}
|
|
6939
6944
|
/** @internal */
|
|
@@ -6976,10 +6981,7 @@ var Parser = class {
|
|
|
6976
6981
|
case InsertionMode.AFTER_BODY:
|
|
6977
6982
|
tokenAfterBody(this, token);
|
|
6978
6983
|
break;
|
|
6979
|
-
case InsertionMode.AFTER_AFTER_BODY:
|
|
6980
|
-
tokenAfterAfterBody(this, token);
|
|
6981
|
-
break;
|
|
6982
|
-
default:
|
|
6984
|
+
case InsertionMode.AFTER_AFTER_BODY: tokenAfterAfterBody(this, token);
|
|
6983
6985
|
}
|
|
6984
6986
|
}
|
|
6985
6987
|
/** @internal */
|
|
@@ -7017,10 +7019,7 @@ var Parser = class {
|
|
|
7017
7019
|
appendCommentToRootHtmlElement(this, token);
|
|
7018
7020
|
break;
|
|
7019
7021
|
case InsertionMode.AFTER_AFTER_BODY:
|
|
7020
|
-
case InsertionMode.AFTER_AFTER_FRAMESET:
|
|
7021
|
-
appendCommentToDocument(this, token);
|
|
7022
|
-
break;
|
|
7023
|
-
default:
|
|
7022
|
+
case InsertionMode.AFTER_AFTER_FRAMESET: appendCommentToDocument(this, token);
|
|
7024
7023
|
}
|
|
7025
7024
|
}
|
|
7026
7025
|
/** @internal */
|
|
@@ -7036,10 +7035,7 @@ var Parser = class {
|
|
|
7036
7035
|
case InsertionMode.AFTER_HEAD:
|
|
7037
7036
|
this._err(token, ERR.misplacedDoctype);
|
|
7038
7037
|
break;
|
|
7039
|
-
case InsertionMode.IN_TABLE_TEXT:
|
|
7040
|
-
tokenInTableText(this, token);
|
|
7041
|
-
break;
|
|
7042
|
-
default:
|
|
7038
|
+
case InsertionMode.IN_TABLE_TEXT: tokenInTableText(this, token);
|
|
7043
7039
|
}
|
|
7044
7040
|
}
|
|
7045
7041
|
/** @internal */
|
|
@@ -7130,10 +7126,7 @@ var Parser = class {
|
|
|
7130
7126
|
case InsertionMode.AFTER_AFTER_BODY:
|
|
7131
7127
|
startTagAfterAfterBody(this, token);
|
|
7132
7128
|
break;
|
|
7133
|
-
case InsertionMode.AFTER_AFTER_FRAMESET:
|
|
7134
|
-
startTagAfterAfterFrameset(this, token);
|
|
7135
|
-
break;
|
|
7136
|
-
default:
|
|
7129
|
+
case InsertionMode.AFTER_AFTER_FRAMESET: startTagAfterAfterFrameset(this, token);
|
|
7137
7130
|
}
|
|
7138
7131
|
}
|
|
7139
7132
|
/** @internal */
|
|
@@ -7209,10 +7202,7 @@ var Parser = class {
|
|
|
7209
7202
|
case InsertionMode.AFTER_FRAMESET:
|
|
7210
7203
|
endTagAfterFrameset(this, token);
|
|
7211
7204
|
break;
|
|
7212
|
-
case InsertionMode.AFTER_AFTER_BODY:
|
|
7213
|
-
tokenAfterAfterBody(this, token);
|
|
7214
|
-
break;
|
|
7215
|
-
default:
|
|
7205
|
+
case InsertionMode.AFTER_AFTER_BODY: tokenAfterAfterBody(this, token);
|
|
7216
7206
|
}
|
|
7217
7207
|
}
|
|
7218
7208
|
/** @internal */
|
|
@@ -7260,10 +7250,7 @@ var Parser = class {
|
|
|
7260
7250
|
case InsertionMode.IN_FRAMESET:
|
|
7261
7251
|
case InsertionMode.AFTER_FRAMESET:
|
|
7262
7252
|
case InsertionMode.AFTER_AFTER_BODY:
|
|
7263
|
-
case InsertionMode.AFTER_AFTER_FRAMESET:
|
|
7264
|
-
stopParsing(this, token);
|
|
7265
|
-
break;
|
|
7266
|
-
default:
|
|
7253
|
+
case InsertionMode.AFTER_AFTER_FRAMESET: stopParsing(this, token);
|
|
7267
7254
|
}
|
|
7268
7255
|
}
|
|
7269
7256
|
/** @internal */
|
|
@@ -7305,10 +7292,7 @@ var Parser = class {
|
|
|
7305
7292
|
case InsertionMode.IN_ROW:
|
|
7306
7293
|
characterInTable(this, token);
|
|
7307
7294
|
break;
|
|
7308
|
-
case InsertionMode.IN_TABLE_TEXT:
|
|
7309
|
-
whitespaceCharacterInTableText(this, token);
|
|
7310
|
-
break;
|
|
7311
|
-
default:
|
|
7295
|
+
case InsertionMode.IN_TABLE_TEXT: whitespaceCharacterInTableText(this, token);
|
|
7312
7296
|
}
|
|
7313
7297
|
}
|
|
7314
7298
|
};
|
|
@@ -7661,10 +7645,7 @@ function modeInBody(p, token) {
|
|
|
7661
7645
|
case TokenType.END_TAG:
|
|
7662
7646
|
endTagInBody(p, token);
|
|
7663
7647
|
break;
|
|
7664
|
-
case TokenType.EOF:
|
|
7665
|
-
eofInBody(p, token);
|
|
7666
|
-
break;
|
|
7667
|
-
default:
|
|
7648
|
+
case TokenType.EOF: eofInBody(p, token);
|
|
7668
7649
|
}
|
|
7669
7650
|
}
|
|
7670
7651
|
function whitespaceCharacterInBody(p, token) {
|
|
@@ -8249,9 +8230,7 @@ function characterInTable(p, token) {
|
|
|
8249
8230
|
case TokenType.CHARACTER:
|
|
8250
8231
|
characterInTableText(p, token);
|
|
8251
8232
|
break;
|
|
8252
|
-
case TokenType.WHITESPACE_CHARACTER:
|
|
8253
|
-
whitespaceCharacterInTableText(p, token);
|
|
8254
|
-
break;
|
|
8233
|
+
case TokenType.WHITESPACE_CHARACTER: whitespaceCharacterInTableText(p, token);
|
|
8255
8234
|
}
|
|
8256
8235
|
} else tokenInTable(p, token);
|
|
8257
8236
|
}
|
|
@@ -8665,10 +8644,7 @@ function startTagInSelect(p, token) {
|
|
|
8665
8644
|
}
|
|
8666
8645
|
break;
|
|
8667
8646
|
case TAG_ID.SCRIPT:
|
|
8668
|
-
case TAG_ID.TEMPLATE:
|
|
8669
|
-
startTagInHead(p, token);
|
|
8670
|
-
break;
|
|
8671
|
-
default:
|
|
8647
|
+
case TAG_ID.TEMPLATE: startTagInHead(p, token);
|
|
8672
8648
|
}
|
|
8673
8649
|
}
|
|
8674
8650
|
function endTagInSelect(p, token) {
|
|
@@ -8686,10 +8662,7 @@ function endTagInSelect(p, token) {
|
|
|
8686
8662
|
p._resetInsertionMode();
|
|
8687
8663
|
}
|
|
8688
8664
|
break;
|
|
8689
|
-
case TAG_ID.TEMPLATE:
|
|
8690
|
-
templateEndTagInHead(p, token);
|
|
8691
|
-
break;
|
|
8692
|
-
default:
|
|
8665
|
+
case TAG_ID.TEMPLATE: templateEndTagInHead(p, token);
|
|
8693
8666
|
}
|
|
8694
8667
|
}
|
|
8695
8668
|
function startTagInSelectInTable(p, token) {
|
|
@@ -8798,10 +8771,7 @@ function startTagInFrameset(p, token) {
|
|
|
8798
8771
|
p._appendElement(token, NS.HTML);
|
|
8799
8772
|
token.ackSelfClosing = true;
|
|
8800
8773
|
break;
|
|
8801
|
-
case TAG_ID.NOFRAMES:
|
|
8802
|
-
startTagInHead(p, token);
|
|
8803
|
-
break;
|
|
8804
|
-
default:
|
|
8774
|
+
case TAG_ID.NOFRAMES: startTagInHead(p, token);
|
|
8805
8775
|
}
|
|
8806
8776
|
}
|
|
8807
8777
|
function endTagInFrameset(p, token) {
|
|
@@ -8815,10 +8785,7 @@ function startTagAfterFrameset(p, token) {
|
|
|
8815
8785
|
case TAG_ID.HTML:
|
|
8816
8786
|
startTagInBody(p, token);
|
|
8817
8787
|
break;
|
|
8818
|
-
case TAG_ID.NOFRAMES:
|
|
8819
|
-
startTagInHead(p, token);
|
|
8820
|
-
break;
|
|
8821
|
-
default:
|
|
8788
|
+
case TAG_ID.NOFRAMES: startTagInHead(p, token);
|
|
8822
8789
|
}
|
|
8823
8790
|
}
|
|
8824
8791
|
function endTagAfterFrameset(p, token) {
|
|
@@ -8837,10 +8804,7 @@ function startTagAfterAfterFrameset(p, token) {
|
|
|
8837
8804
|
case TAG_ID.HTML:
|
|
8838
8805
|
startTagInBody(p, token);
|
|
8839
8806
|
break;
|
|
8840
|
-
case TAG_ID.NOFRAMES:
|
|
8841
|
-
startTagInHead(p, token);
|
|
8842
|
-
break;
|
|
8843
|
-
default:
|
|
8807
|
+
case TAG_ID.NOFRAMES: startTagInHead(p, token);
|
|
8844
8808
|
}
|
|
8845
8809
|
}
|
|
8846
8810
|
function nullCharacterInForeignContent(p, token) {
|
|
@@ -9081,13 +9045,15 @@ var VFileMessage = class extends Error {
|
|
|
9081
9045
|
/** @type {Options} */
|
|
9082
9046
|
let options = {};
|
|
9083
9047
|
let legacyCause = false;
|
|
9084
|
-
if (optionsOrParentOrPlace)
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9048
|
+
if (optionsOrParentOrPlace) {
|
|
9049
|
+
if ("line" in optionsOrParentOrPlace && "column" in optionsOrParentOrPlace) options = { place: optionsOrParentOrPlace };
|
|
9050
|
+
else if ("start" in optionsOrParentOrPlace && "end" in optionsOrParentOrPlace) options = { place: optionsOrParentOrPlace };
|
|
9051
|
+
else if ("type" in optionsOrParentOrPlace) options = {
|
|
9052
|
+
ancestors: [optionsOrParentOrPlace],
|
|
9053
|
+
place: optionsOrParentOrPlace.position
|
|
9054
|
+
};
|
|
9055
|
+
else options = { ...optionsOrParentOrPlace };
|
|
9056
|
+
}
|
|
9091
9057
|
if (typeof causeOrReason === "string") reason = causeOrReason;
|
|
9092
9058
|
else if (!options.cause && causeOrReason) {
|
|
9093
9059
|
legacyCause = true;
|
|
@@ -9288,11 +9254,13 @@ function basename(path, extname) {
|
|
|
9288
9254
|
seenNonSlash = true;
|
|
9289
9255
|
firstNonSlashEnd = index + 1;
|
|
9290
9256
|
}
|
|
9291
|
-
if (extnameIndex > -1)
|
|
9292
|
-
if (
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
|
|
9257
|
+
if (extnameIndex > -1) {
|
|
9258
|
+
if (path.codePointAt(index) === extname.codePointAt(extnameIndex--)) {
|
|
9259
|
+
if (extnameIndex < 0) end = index;
|
|
9260
|
+
} else {
|
|
9261
|
+
extnameIndex = -1;
|
|
9262
|
+
end = firstNonSlashEnd;
|
|
9263
|
+
}
|
|
9296
9264
|
}
|
|
9297
9265
|
}
|
|
9298
9266
|
if (start === end) end = firstNonSlashEnd;
|
|
@@ -12597,9 +12565,11 @@ function wrap(middleware, callback) {
|
|
|
12597
12565
|
if (fnExpectsCallback && called) throw exception;
|
|
12598
12566
|
return done(exception);
|
|
12599
12567
|
}
|
|
12600
|
-
if (!fnExpectsCallback)
|
|
12601
|
-
|
|
12602
|
-
|
|
12568
|
+
if (!fnExpectsCallback) {
|
|
12569
|
+
if (result && result.then && typeof result.then === "function") result.then(then, done);
|
|
12570
|
+
else if (result instanceof Error) done(result);
|
|
12571
|
+
else then(result);
|
|
12572
|
+
}
|
|
12603
12573
|
}
|
|
12604
12574
|
/**
|
|
12605
12575
|
* Call `callback`, only once.
|
|
@@ -13572,9 +13542,10 @@ var unified = new class Processor extends CallableInstance {
|
|
|
13572
13542
|
const namespace = this.namespace;
|
|
13573
13543
|
assertUnfrozen("use", this.frozen);
|
|
13574
13544
|
if (value === null || value === void 0) {} else if (typeof value === "function") addPlugin(value, parameters);
|
|
13575
|
-
else if (typeof value === "object")
|
|
13576
|
-
|
|
13577
|
-
|
|
13545
|
+
else if (typeof value === "object") {
|
|
13546
|
+
if (Array.isArray(value)) addList(value);
|
|
13547
|
+
else addPreset(value);
|
|
13548
|
+
} else throw new TypeError("Expected usable value, not `" + value + "`");
|
|
13578
13549
|
return this;
|
|
13579
13550
|
/**
|
|
13580
13551
|
* @param {Pluggable} value
|
|
@@ -13582,11 +13553,12 @@ var unified = new class Processor extends CallableInstance {
|
|
|
13582
13553
|
*/
|
|
13583
13554
|
function add(value) {
|
|
13584
13555
|
if (typeof value === "function") addPlugin(value, []);
|
|
13585
|
-
else if (typeof value === "object")
|
|
13586
|
-
|
|
13587
|
-
|
|
13588
|
-
|
|
13589
|
-
|
|
13556
|
+
else if (typeof value === "object") {
|
|
13557
|
+
if (Array.isArray(value)) {
|
|
13558
|
+
const [plugin, ...parameters] = value;
|
|
13559
|
+
addPlugin(plugin, parameters);
|
|
13560
|
+
} else addPreset(value);
|
|
13561
|
+
} else throw new TypeError("Expected usable value, not `" + value + "`");
|
|
13590
13562
|
}
|
|
13591
13563
|
/**
|
|
13592
13564
|
* @param {Preset} result
|