polytypo 1.17.1 → 1.17.2
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/dist/chunk-4YXTHZIB.cjs +38 -0
- package/dist/{chunk-S3THC23S.cjs.map → chunk-4YXTHZIB.cjs.map} +1 -1
- package/dist/{chunk-5VDPW7O6.js → chunk-4ZRTKEZA.js} +2 -2
- package/dist/{chunk-SPY3OYVJ.cjs → chunk-7DJG5YVG.cjs} +125 -25
- package/dist/chunk-7DJG5YVG.cjs.map +1 -0
- package/dist/{chunk-QGPUYIQ6.cjs → chunk-AWTKVV4E.cjs} +43 -8
- package/dist/{chunk-QGPUYIQ6.cjs.map → chunk-AWTKVV4E.cjs.map} +1 -1
- package/dist/{chunk-JHUR3KFU.js → chunk-BXENIIJD.js} +42 -7
- package/dist/{chunk-JHUR3KFU.js.map → chunk-BXENIIJD.js.map} +1 -1
- package/dist/{chunk-U36ZYZQT.js → chunk-D5X53S7D.js} +2 -2
- package/dist/{chunk-6YZ4D72Q.js → chunk-DWQ3SDHS.js} +2 -2
- package/dist/chunk-KZWW24OZ.cjs +36 -0
- package/dist/{chunk-KH57BTH6.cjs.map → chunk-KZWW24OZ.cjs.map} +1 -1
- package/dist/{chunk-R6IILWU3.cjs → chunk-LLKXGT4D.cjs} +6 -6
- package/dist/{chunk-R6IILWU3.cjs.map → chunk-LLKXGT4D.cjs.map} +1 -1
- package/dist/{chunk-UA7MQNBN.js → chunk-OQRJ5BMU.js} +107 -7
- package/dist/chunk-OQRJ5BMU.js.map +1 -0
- package/dist/{chunk-5WFLLIUG.js → chunk-S7NXM2JK.js} +2 -2
- package/dist/{chunk-3L3BHUAF.js → chunk-TQMYJT3L.js} +3 -3
- package/dist/chunk-UMRHMNDF.cjs +34 -0
- package/dist/{chunk-DBNA7GVR.cjs.map → chunk-UMRHMNDF.cjs.map} +1 -1
- package/dist/{chunk-3PERF7A2.cjs → chunk-VNWEZQWP.cjs} +3 -3
- package/dist/{chunk-3PERF7A2.cjs.map → chunk-VNWEZQWP.cjs.map} +1 -1
- package/dist/{chunk-PXBKWYVG.cjs → chunk-YV5DI7CN.cjs} +4 -4
- package/dist/{chunk-PXBKWYVG.cjs.map → chunk-YV5DI7CN.cjs.map} +1 -1
- package/dist/{chunk-LHYTW5VQ.js → chunk-ZC2JQGJN.js} +3 -3
- package/dist/html.cjs +9 -9
- package/dist/html.js +4 -4
- package/dist/index.cjs +17 -17
- package/dist/index.js +7 -7
- package/dist/markdown.cjs +10 -10
- package/dist/markdown.js +5 -5
- package/dist/text.cjs +8 -8
- package/dist/text.js +3 -3
- package/dist/yaml.cjs +9 -9
- package/dist/yaml.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-DBNA7GVR.cjs +0 -34
- package/dist/chunk-KH57BTH6.cjs +0 -36
- package/dist/chunk-S3THC23S.cjs +0 -38
- package/dist/chunk-SPY3OYVJ.cjs.map +0 -1
- package/dist/chunk-UA7MQNBN.js.map +0 -1
- /package/dist/{chunk-5VDPW7O6.js.map → chunk-4ZRTKEZA.js.map} +0 -0
- /package/dist/{chunk-U36ZYZQT.js.map → chunk-D5X53S7D.js.map} +0 -0
- /package/dist/{chunk-6YZ4D72Q.js.map → chunk-DWQ3SDHS.js.map} +0 -0
- /package/dist/{chunk-5WFLLIUG.js.map → chunk-S7NXM2JK.js.map} +0 -0
- /package/dist/{chunk-3L3BHUAF.js.map → chunk-TQMYJT3L.js.map} +0 -0
- /package/dist/{chunk-LHYTW5VQ.js.map → chunk-ZC2JQGJN.js.map} +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkYV5DI7CNcjs = require('./chunk-YV5DI7CN.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunkAWTKVV4Ecjs = require('./chunk-AWTKVV4E.cjs');
|
|
12
|
+
|
|
13
|
+
// src/engine/html-pipeline.ts
|
|
14
|
+
function runHtmlPipeline(input, options) {
|
|
15
|
+
const narrowTarget = _chunkAWTKVV4Ecjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
16
|
+
const planned = _chunkAWTKVV4Ecjs.planRules.call(void 0, options.rules);
|
|
17
|
+
const locale = _chunkAWTKVV4Ecjs.getLocaleData.call(void 0, options.locale);
|
|
18
|
+
_chunkAWTKVV4Ecjs.assertNoProtect.call(void 0, options.protect, "html");
|
|
19
|
+
const spans = _chunkYV5DI7CNcjs.htmlSpans.call(void 0, input);
|
|
20
|
+
return _chunkAWTKVV4Ecjs.runOverSpans.call(void 0, input, spans, planned, locale, "html", narrowTarget);
|
|
21
|
+
}
|
|
22
|
+
function analyzeHtmlPipeline(input, options) {
|
|
23
|
+
const narrowTarget = _chunkAWTKVV4Ecjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
24
|
+
const planned = _chunkAWTKVV4Ecjs.planRules.call(void 0, options.rules);
|
|
25
|
+
const locale = _chunkAWTKVV4Ecjs.getLocaleData.call(void 0, options.locale);
|
|
26
|
+
_chunkAWTKVV4Ecjs.assertNoProtect.call(void 0, options.protect, "html");
|
|
27
|
+
return _chunkAWTKVV4Ecjs.analyzeOverSpans.call(void 0, input, _chunkYV5DI7CNcjs.htmlSpans.call(void 0, input), planned, locale, "html", narrowTarget);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
exports.runHtmlPipeline = runHtmlPipeline; exports.analyzeHtmlPipeline = analyzeHtmlPipeline;
|
|
34
|
+
//# sourceMappingURL=chunk-UMRHMNDF.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-UMRHMNDF.cjs","../src/engine/html-pipeline.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACMO,SAAS,eAAA,CAAgB,KAAA,EAAe,OAAA,EAAmC;AAChF,EAAA,MAAM,aAAA,EAAe,mDAAA,OAAoB,CAAQ,UAAU,CAAA;AAC3D,EAAA,MAAM,QAAA,EAAU,yCAAA,OAAU,CAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,OAAA,EAAS,6CAAA,OAAc,CAAQ,MAAM,CAAA;AAC3C,EAAA,+CAAA,OAAgB,CAAQ,OAAA,EAAS,MAAM,CAAA;AACvC,EAAA,MAAM,MAAA,EAAQ,yCAAA,KAAe,CAAA;AAC7B,EAAA,OAAO,4CAAA,KAAa,EAAO,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,YAAY,CAAA;AACzE;AAGO,SAAS,mBAAA,CAAoB,KAAA,EAAe,OAAA,EAAqC;AACtF,EAAA,MAAM,aAAA,EAAe,mDAAA,OAAoB,CAAQ,UAAU,CAAA;AAC3D,EAAA,MAAM,QAAA,EAAU,yCAAA,OAAU,CAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,OAAA,EAAS,6CAAA,OAAc,CAAQ,MAAM,CAAA;AAC3C,EAAA,+CAAA,OAAgB,CAAQ,OAAA,EAAS,MAAM,CAAA;AACvC,EAAA,OAAO,gDAAA,KAAiB,EAAO,yCAAA,KAAe,CAAA,EAAG,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,YAAY,CAAA;AACxF;ADNA;AACA;AACE;AACA;AACF,6FAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/chunk-UMRHMNDF.cjs","sourcesContent":[null,"import { htmlSpans } from \"../modes/html.js\";\nimport type { Options } from \"../types.js\";\nimport { getLocaleData } from \"./locale.js\";\nimport { resolveNarrowTarget } from \"./narrow-target.js\";\nimport { assertNoProtect } from \"./protect.js\";\nimport { planRules } from \"./rule-runner.js\";\nimport { analyzeOverSpans, runOverSpans } from \"./span-runner.js\";\nimport type { Change } from \"./origin.js\";\n\n/**\n * `html` mode only. Imports `parse5` (via `../modes/html.js`) and nothing from\n * `../modes/markdown.js` or the Micromark/MDX stack — this is what makes `polytypo/html`'s\n * module graph exclude the Markdown parser (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1).\n *\n * Validation order — `planRules` before `getLocaleData` before parsing — mirrors the pre-Stage-5\n * aggregate `runPipeline` exactly (an unknown-rule error must win over an unknown-locale error,\n * and both must win over a parse failure, since that is public, tested behaviour).\n */\nexport function runHtmlPipeline(input: string, options: Partial<Options>): string {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n assertNoProtect(options.protect, \"html\");\n const spans = htmlSpans(input);\n return runOverSpans(input, spans, planned, locale, \"html\", narrowTarget);\n}\n\n/** analyze.md §1, `html` mode: offsets are into the document, not into a span (analyze.md §6). */\nexport function analyzeHtmlPipeline(input: string, options: Partial<Options>): Change[] {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n assertNoProtect(options.protect, \"html\");\n return analyzeOverSpans(input, htmlSpans(input), planned, locale, \"html\", narrowTarget);\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkAWTKVV4Ecjs = require('./chunk-AWTKVV4E.cjs');
|
|
4
4
|
|
|
5
5
|
// src/engine/assert-fixed-mode.ts
|
|
6
6
|
function assertFixedMode(mode, fixed, entryPoint) {
|
|
7
7
|
if (mode === void 0 || mode === fixed) return;
|
|
8
|
-
throw new (0,
|
|
8
|
+
throw new (0, _chunkAWTKVV4Ecjs.PolytypoError)(
|
|
9
9
|
"POLYTYPO_INVALID_MODE",
|
|
10
10
|
`"${entryPoint}" only supports mode "${fixed}". Received "${String(mode)}" \u2014 import from "polytypo" for the other modes, or omit \`mode\` here.`
|
|
11
11
|
);
|
|
@@ -14,4 +14,4 @@ function assertFixedMode(mode, fixed, entryPoint) {
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
exports.assertFixedMode = assertFixedMode;
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-VNWEZQWP.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-VNWEZQWP.cjs","../src/engine/assert-fixed-mode.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACMO,SAAS,eAAA,CAAgB,IAAA,EAAe,KAAA,EAAa,UAAA,EAA0B;AACpF,EAAA,GAAA,CAAI,KAAA,IAAS,KAAA,EAAA,GAAa,KAAA,IAAS,KAAA,EAAO,MAAA;AAC1C,EAAA,MAAM,IAAI,oCAAA;AAAA,IACR,uBAAA;AAAA,IACA,CAAA,CAAA,EAAI,UAAU,CAAA,sBAAA,EAAyB,KAAK,CAAA,aAAA,EAAgB,MAAA,CAAO,IAAI,CAAC,CAAA,2EAAA;AAAA,EAE1E,CAAA;AACF;ADLA;AACA;AACE;AACF,0CAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/chunk-VNWEZQWP.cjs","sourcesContent":[null,"import { PolytypoError } from \"../errors.js\";\nimport type { Mode } from \"../types.js\";\n\n/**\n * `polytypo/text`, `polytypo/html` and `polytypo/markdown` each fix `mode` at the type level by\n * omitting it from their Options type (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1, criterion 6).\n * A plain-JS caller — or a TypeScript caller passing a wider-typed variable, which excess-property\n * checking does not catch — can still supply a conflicting `mode` at runtime. That is rejected\n * explicitly here, never silently ignored or overridden.\n */\nexport function assertFixedMode(mode: unknown, fixed: Mode, entryPoint: string): void {\n if (mode === undefined || mode === fixed) return;\n throw new PolytypoError(\n \"POLYTYPO_INVALID_MODE\",\n `\"${entryPoint}\" only supports mode \"${fixed}\". Received \"${String(mode)}\" — ` +\n `import from \"polytypo\" for the other modes, or omit \\`mode\\` here.`,\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkAWTKVV4Ecjs = require('./chunk-AWTKVV4E.cjs');
|
|
4
4
|
|
|
5
5
|
// src/modes/html.ts
|
|
6
6
|
var _parse5 = require('parse5');
|
|
@@ -20,8 +20,8 @@ function wrapParserErrors(what, run) {
|
|
|
20
20
|
try {
|
|
21
21
|
return run();
|
|
22
22
|
} catch (error) {
|
|
23
|
-
if (error instanceof
|
|
24
|
-
throw new (0,
|
|
23
|
+
if (error instanceof _chunkAWTKVV4Ecjs.PolytypoError) throw error;
|
|
24
|
+
throw new (0, _chunkAWTKVV4Ecjs.PolytypoError)(
|
|
25
25
|
"POLYTYPO_MALFORMED_INPUT",
|
|
26
26
|
`Input does not parse as ${what}: ${describe(error)}`
|
|
27
27
|
);
|
|
@@ -144,4 +144,4 @@ function htmlFragmentSpans(source, offset) {
|
|
|
144
144
|
|
|
145
145
|
|
|
146
146
|
exports.wrapParserErrors = wrapParserErrors; exports.isSkippedElement = isSkippedElement; exports.htmlSpans = htmlSpans; exports.htmlFragmentSpans = htmlFragmentSpans;
|
|
147
|
-
//# sourceMappingURL=chunk-
|
|
147
|
+
//# sourceMappingURL=chunk-YV5DI7CN.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-YV5DI7CN.cjs","../src/modes/html.ts","../src/modes/parse-error.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACJA,gCAAqC;ADMrC;AACA;AEAA,SAAS,QAAA,CAAS,KAAA,EAAwB;AACxC,EAAA,GAAA,CAAI,OAAO,MAAA,IAAU,SAAA,GAAY,MAAA,IAAU,IAAA,EAAM,OAAO,MAAA,CAAO,KAAK,CAAA;AACpE,EAAA,MAAM,WAAA,EAAa,KAAA;AACnB,EAAA,MAAM,OAAA,EACJ,OAAO,UAAA,CAAW,OAAA,IAAW,SAAA,EAAW,UAAA,CAAW,OAAA,EAAU,KAAA,CAAgB,OAAA;AAC/E,EAAA,MAAM,MAAA,EAAQ,UAAA,CAAW,KAAA;AACzB,EAAA,GAAA,CACE,MAAA,IAAU,KAAA,GACV,MAAA,IAAU,KAAA,EAAA,GACV,OAAO,KAAA,CAAM,KAAA,IAAS,SAAA,GACtB,OAAO,KAAA,CAAM,OAAA,IAAW,QAAA,EACxB;AACA,IAAA,OAAO,CAAA,EAAA;AACT,EAAA;AACO,EAAA;AACT;AAcgB;AACV,EAAA;AACK,IAAA;AACA,EAAA;AACH,IAAA;AACE,IAAA;AACJ,MAAA;AACA,MAAA;AACF,IAAA;AACF,EAAA;AACF;AFjBY;AACA;ACfN;AACJ,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACD;AAEe;AACP,EAAA;AACT;AAEM;AACA;AACO;AACP;AACA;AAGA;AAEG;AACA,EAAA;AACT;AAES;AACA,EAAA;AACT;AAES;AACA,EAAA;AACT;AAQS;AACH,EAAA;AACI,EAAA;AACC,EAAA;AAEL,EAAA;AACG,IAAA;AACC,IAAA;AACA,IAAA;AACG,IAAA;AACH,IAAA;AAEJ,IAAA;AAGK,MAAA;AACP,IAAA;AACI,IAAA;AACG,IAAA;AACT,EAAA;AAEM,EAAA;AAEJ,EAAA;AAIK,IAAA;AACP,EAAA;AACU,EAAA;AACH,EAAA;AACT;AAOgB;AACR,EAAA;AACF,EAAA;AACI,EAAA;AACD,EAAA;AACD,IAAA;AACI,MAAA;AACF,MAAA;AACE,QAAA;AACJ,QAAA;AACI,QAAA;AACJ,QAAA;AACF,MAAA;AACF,IAAA;AACK,IAAA;AACP,EAAA;AACU,EAAA;AACH,EAAA;AACT;AAES;AACA,EAAA;AACT;AAES;AACE,EAAA;AACD,IAAA;AACF,IAAA;AACJ,IAAA;AACQ,MAAA;AACR,IAAA;AACA,IAAA;AACF,EAAA;AAGS,EAAA;AAEL,EAAA;AAGK,EAAA;AACC,IAAA;AACR,IAAA;AACF,EAAA;AAEK,EAAA;AACL,EAAA;AACF;AAQgB;AACR,EAAA;AACA,EAAA;AACE,EAAA;AACD,EAAA;AACT;AAGgB;AACR,EAAA;AAA4B,IAAA;AAChC,IAAA;AACF,EAAA;AACM,EAAA;AACE,EAAA;AACD,EAAA;AAGT;AD9BY;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/polytypo-js/polytypo-js/dist/chunk-YV5DI7CN.cjs","sourcesContent":[null,"import { parse, parseFragment } from \"parse5\";\nimport type { DefaultTreeAdapterMap } from \"parse5\";\nimport { wrapParserErrors } from \"./parse-error.js\";\nimport type { Span } from \"./spans.js\";\n\ntype Node = DefaultTreeAdapterMap[\"node\"];\ntype ParentNode = DefaultTreeAdapterMap[\"parentNode\"];\n\n/**\n * spec/rules/modes.md 3.6, exhaustive and **closed**: extending it is a spec change, not an\n * implementation decision. `svg` and `math` are here because in MathML a quotation mark, a\n * hyphen and a prime are operators and identifiers — substituting a curly glyph changes what\n * the expression means. Everything not listed is processable, **including unknown and custom\n * elements**: guessing from a tag name is exactly the heuristic that diverges across runtimes.\n */\nconst SKIPPED_ELEMENTS: ReadonlySet<string> = new Set([\n \"code\",\n \"pre\",\n \"kbd\",\n \"samp\",\n \"var\",\n \"script\",\n \"style\",\n \"textarea\",\n \"svg\",\n \"math\",\n]);\n\nexport function isSkippedElement(tagName: string): boolean {\n return SKIPPED_ELEMENTS.has(tagName);\n}\n\nconst AMPERSAND = 0x26;\nconst SEMICOLON = 0x3b;\nconst HASH = 0x23;\nconst LOWER_X = 0x78;\nconst UPPER_X = 0x58;\n\n/** Longest named reference in the WHATWG table is 32 characters; the guard is a bound, not a rule. */\nconst MAX_REFERENCE_BODY = 34;\n\nfunction isAsciiDigit(unit: number): boolean {\n return unit >= 0x30 && unit <= 0x39;\n}\n\nfunction isAsciiHexDigit(unit: number): boolean {\n return isAsciiDigit(unit) || (unit >= 0x61 && unit <= 0x66) || (unit >= 0x41 && unit <= 0x46);\n}\n\nfunction isAsciiAlphanumeric(unit: number): boolean {\n return isAsciiDigit(unit) || (unit >= 0x61 && unit <= 0x7a) || (unit >= 0x41 && unit <= 0x5a);\n}\n\n/**\n * The end offset of a well-formed character reference starting at `at`, or -1. A bare `&` that a\n * parser would repair is deliberately **not** treated as a reference: it stays inside the span,\n * where no rule can emit or delete it, rather than manufacturing a boundary that suppresses\n * conversions around it.\n */\nfunction characterReferenceEnd(source: string, at: number, limit: number): number {\n if (source.charCodeAt(at) !== AMPERSAND) return -1;\n let i = at + 1;\n if (i >= limit) return -1;\n\n if (source.charCodeAt(i) === HASH) {\n i += 1;\n const unit = i < limit ? source.charCodeAt(i) : -1;\n const hex = unit === LOWER_X || unit === UPPER_X;\n if (hex) i += 1;\n const digitsAt = i;\n while (\n i < limit &&\n (hex ? isAsciiHexDigit(source.charCodeAt(i)) : isAsciiDigit(source.charCodeAt(i)))\n ) {\n i += 1;\n }\n if (i === digitsAt) return -1;\n return i < limit && source.charCodeAt(i) === SEMICOLON ? i + 1 : -1;\n }\n\n const nameAt = i;\n while (\n i < limit &&\n i - nameAt < MAX_REFERENCE_BODY &&\n isAsciiAlphanumeric(source.charCodeAt(i))\n ) {\n i += 1;\n }\n if (i === nameAt) return -1;\n return i < limit && source.charCodeAt(i) === SEMICOLON ? i + 1 : -1;\n}\n\n/**\n * modes.md 3.6: every character reference is skipped as an **opaque unit**, and a text node\n * containing one is split into spans around it. That is the only way ` ` survives as\n * ` ` instead of becoming a literal U+00A0 on the way out.\n */\nexport function splitCharacterReferences(source: string, start: number, end: number): Span[] {\n const spans: Span[] = [];\n let cursor = start;\n let i = start;\n while (i < end) {\n if (source.charCodeAt(i) === AMPERSAND) {\n const stop = characterReferenceEnd(source, i, end);\n if (stop > 0) {\n if (i > cursor) spans.push({ start: cursor, end: i });\n cursor = stop;\n i = stop;\n continue;\n }\n }\n i += 1;\n }\n if (end > cursor) spans.push({ start: cursor, end });\n return spans;\n}\n\nfunction isParent(node: Node): node is ParentNode {\n return \"childNodes\" in node;\n}\n\nfunction collect(node: Node, source: string, spans: Span[]): void {\n if (node.nodeName === \"#text\") {\n const location = node.sourceCodeLocation;\n if (location === undefined || location === null) return;\n for (const span of splitCharacterReferences(source, location.startOffset, location.endOffset)) {\n spans.push(span);\n }\n return;\n }\n\n // Comments, doctype and processing instructions never contribute a span (modes.md 3.6).\n if (node.nodeName === \"#comment\" || node.nodeName === \"#documentType\") return;\n\n if (\"tagName\" in node && isSkippedElement(node.tagName)) return;\n\n // A `template`'s children live in a separate document fragment; `template` is not skipped.\n if (node.nodeName === \"template\" && \"content\" in node) {\n collect(node.content, source, spans);\n return;\n }\n\n if (!isParent(node)) return;\n for (const child of node.childNodes) collect(child, source, spans);\n}\n\n/**\n * Locate the processable spans of an HTML document. The tree is used only to find offsets and is\n * then discarded — modes.md 4 forbids reserialisation, which is what makes attribute quoting,\n * self-closing forms, entity spelling, tag case and malformed-input recovery preserved by\n * construction rather than by effort.\n */\nexport function htmlSpans(source: string): Span[] {\n const document = wrapParserErrors(\"HTML\", () => parse(source, { sourceCodeLocationInfo: true }));\n const spans: Span[] = [];\n collect(document, source, spans);\n return spans;\n}\n\n/** The same, for a fragment: used for HTML blocks embedded in markdown (modes.md 3.7). */\nexport function htmlFragmentSpans(source: string, offset: number): Span[] {\n const fragment = wrapParserErrors(\"HTML\", () =>\n parseFragment(source, { sourceCodeLocationInfo: true }),\n );\n const spans: Span[] = [];\n collect(fragment, source, spans);\n return offset === 0\n ? spans\n : spans.map((span) => ({ start: span.start + offset, end: span.end + offset }));\n}\n","import { PolytypoError } from \"../errors.js\";\n\ninterface PositionedError {\n readonly reason?: unknown;\n readonly place?: { readonly line?: unknown; readonly column?: unknown } | null;\n}\n\nfunction describe(error: unknown): string {\n if (typeof error !== \"object\" || error === null) return String(error);\n const positioned = error as PositionedError;\n const reason =\n typeof positioned.reason === \"string\" ? positioned.reason : (error as Error).message;\n const place = positioned.place;\n if (\n place !== null &&\n place !== undefined &&\n typeof place.line === \"number\" &&\n typeof place.column === \"number\"\n ) {\n return `${reason} (line ${place.line}, column ${place.column})`;\n }\n return reason;\n}\n\n/**\n * spec/rules/modes.md 3.7.2. **The parser's own error type must never escape.** A\n * `VFileMessage`, a `Nokogiri::SyntaxError` or a Python exception on the public surface puts a\n * dependency's type into the contract and is unreproducible in the other four runtimes; only the\n * code is contractual (ARCHITECTURE.md 4.6), while the message and the source position are\n * useful and are not.\n *\n * Reachable in exactly one place: `dialect: \"mdx\"`, because MDX embeds JavaScript. HTML parsing\n * is specified with total error recovery and every byte sequence is valid CommonMark, so neither\n * of the other two languages can fail. The wrapper is applied to all of them anyway — the\n * guarantee is that no parser type escapes, not that this particular parser is trusted.\n */\nexport function wrapParserErrors<T>(what: string, run: () => T): T {\n try {\n return run();\n } catch (error) {\n if (error instanceof PolytypoError) throw error;\n throw new PolytypoError(\n \"POLYTYPO_MALFORMED_INPUT\",\n `Input does not parse as ${what}: ${describe(error)}`,\n );\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveYamlKeys,
|
|
3
3
|
yamlSpans
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4ZRTKEZA.js";
|
|
5
5
|
import {
|
|
6
6
|
analyzeOverSpans,
|
|
7
7
|
assertNoProtect,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
planRules,
|
|
10
10
|
resolveNarrowTarget,
|
|
11
11
|
runOverSpans
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BXENIIJD.js";
|
|
13
13
|
|
|
14
14
|
// src/engine/yaml-pipeline.ts
|
|
15
15
|
function runYamlPipeline(input, options) {
|
|
@@ -33,4 +33,4 @@ export {
|
|
|
33
33
|
runYamlPipeline,
|
|
34
34
|
analyzeYamlPipeline
|
|
35
35
|
};
|
|
36
|
-
//# sourceMappingURL=chunk-
|
|
36
|
+
//# sourceMappingURL=chunk-ZC2JQGJN.js.map
|
package/dist/html.cjs
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunkUMRHMNDFcjs = require('./chunk-UMRHMNDF.cjs');
|
|
5
|
+
require('./chunk-YV5DI7CN.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkVNWEZQWPcjs = require('./chunk-VNWEZQWP.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkAWTKVV4Ecjs = require('./chunk-AWTKVV4E.cjs');
|
|
12
12
|
|
|
13
13
|
// src/index.html.ts
|
|
14
14
|
function transform(input, options) {
|
|
15
15
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
16
|
-
|
|
17
|
-
return
|
|
16
|
+
_chunkVNWEZQWPcjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
|
|
17
|
+
return _chunkUMRHMNDFcjs.runHtmlPipeline.call(void 0, input, given);
|
|
18
18
|
}
|
|
19
19
|
function analyze(input, options) {
|
|
20
20
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
21
|
-
|
|
22
|
-
return
|
|
21
|
+
_chunkVNWEZQWPcjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
|
|
22
|
+
return _chunkUMRHMNDFcjs.analyzeHtmlPipeline.call(void 0, input, given);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
exports.PolytypoError =
|
|
28
|
+
exports.PolytypoError = _chunkAWTKVV4Ecjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
29
29
|
//# sourceMappingURL=html.cjs.map
|
package/dist/html.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeHtmlPipeline,
|
|
3
3
|
runHtmlPipeline
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-TQMYJT3L.js";
|
|
5
|
+
import "./chunk-D5X53S7D.js";
|
|
6
6
|
import {
|
|
7
7
|
assertFixedMode
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DWQ3SDHS.js";
|
|
9
9
|
import {
|
|
10
10
|
PolytypoError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BXENIIJD.js";
|
|
12
12
|
|
|
13
13
|
// src/index.html.ts
|
|
14
14
|
function transform(input, options) {
|
package/dist/index.cjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk4YXTHZIBcjs = require('./chunk-4YXTHZIB.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkUMRHMNDFcjs = require('./chunk-UMRHMNDF.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
12
|
+
var _chunk7DJG5YVGcjs = require('./chunk-7DJG5YVG.cjs');
|
|
13
|
+
require('./chunk-YV5DI7CN.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
18
|
-
require('./chunk-
|
|
17
|
+
var _chunkKZWW24OZcjs = require('./chunk-KZWW24OZ.cjs');
|
|
18
|
+
require('./chunk-LLKXGT4D.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkAWTKVV4Ecjs = require('./chunk-AWTKVV4E.cjs');
|
|
22
22
|
|
|
23
23
|
// src/engine/pipeline.ts
|
|
24
24
|
function resolveMode(mode) {
|
|
25
25
|
if (mode === void 0 || mode === "text") return "text";
|
|
26
26
|
if (mode === "html" || mode === "markdown" || mode === "yaml") return mode;
|
|
27
|
-
throw new (0,
|
|
27
|
+
throw new (0, _chunkAWTKVV4Ecjs.PolytypoError)(
|
|
28
28
|
"POLYTYPO_INVALID_MODE",
|
|
29
29
|
`Unknown mode "${String(mode)}". Expected "text", "html", "markdown" or "yaml".`
|
|
30
30
|
);
|
|
@@ -32,18 +32,18 @@ function resolveMode(mode) {
|
|
|
32
32
|
function runPipeline(input, options) {
|
|
33
33
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
34
34
|
const mode = resolveMode(given.mode);
|
|
35
|
-
if (mode === "text") return
|
|
36
|
-
if (mode === "html") return
|
|
37
|
-
if (mode === "yaml") return
|
|
38
|
-
return
|
|
35
|
+
if (mode === "text") return _chunk4YXTHZIBcjs.runTextPipeline.call(void 0, input, given);
|
|
36
|
+
if (mode === "html") return _chunkUMRHMNDFcjs.runHtmlPipeline.call(void 0, input, given);
|
|
37
|
+
if (mode === "yaml") return _chunkKZWW24OZcjs.runYamlPipeline.call(void 0, input, given);
|
|
38
|
+
return _chunk7DJG5YVGcjs.runMarkdownPipeline.call(void 0, input, given);
|
|
39
39
|
}
|
|
40
40
|
function runAnalyze(input, options) {
|
|
41
41
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
42
42
|
const mode = resolveMode(given.mode);
|
|
43
|
-
if (mode === "text") return
|
|
44
|
-
if (mode === "html") return
|
|
45
|
-
if (mode === "yaml") return
|
|
46
|
-
return
|
|
43
|
+
if (mode === "text") return _chunk4YXTHZIBcjs.analyzeTextPipeline.call(void 0, input, given);
|
|
44
|
+
if (mode === "html") return _chunkUMRHMNDFcjs.analyzeHtmlPipeline.call(void 0, input, given);
|
|
45
|
+
if (mode === "yaml") return _chunkKZWW24OZcjs.analyzeYamlPipeline.call(void 0, input, given);
|
|
46
|
+
return _chunk7DJG5YVGcjs.analyzeMarkdownPipeline.call(void 0, input, given);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// src/index.ts
|
|
@@ -57,5 +57,5 @@ function analyze(input, options) {
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
exports.PolytypoError =
|
|
60
|
+
exports.PolytypoError = _chunkAWTKVV4Ecjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
61
61
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeTextPipeline,
|
|
3
3
|
runTextPipeline
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-S7NXM2JK.js";
|
|
5
5
|
import {
|
|
6
6
|
analyzeHtmlPipeline,
|
|
7
7
|
runHtmlPipeline
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TQMYJT3L.js";
|
|
9
9
|
import {
|
|
10
10
|
analyzeMarkdownPipeline,
|
|
11
11
|
runMarkdownPipeline
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-OQRJ5BMU.js";
|
|
13
|
+
import "./chunk-D5X53S7D.js";
|
|
14
14
|
import {
|
|
15
15
|
analyzeYamlPipeline,
|
|
16
16
|
runYamlPipeline
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-ZC2JQGJN.js";
|
|
18
|
+
import "./chunk-4ZRTKEZA.js";
|
|
19
19
|
import {
|
|
20
20
|
PolytypoError
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-BXENIIJD.js";
|
|
22
22
|
|
|
23
23
|
// src/engine/pipeline.ts
|
|
24
24
|
function resolveMode(mode) {
|
package/dist/markdown.cjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
4
|
+
var _chunk7DJG5YVGcjs = require('./chunk-7DJG5YVG.cjs');
|
|
5
|
+
require('./chunk-YV5DI7CN.cjs');
|
|
6
|
+
require('./chunk-LLKXGT4D.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkVNWEZQWPcjs = require('./chunk-VNWEZQWP.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkAWTKVV4Ecjs = require('./chunk-AWTKVV4E.cjs');
|
|
13
13
|
|
|
14
14
|
// src/index.markdown.ts
|
|
15
15
|
function transform(input, options) {
|
|
16
16
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
17
|
-
|
|
18
|
-
return
|
|
17
|
+
_chunkVNWEZQWPcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
|
|
18
|
+
return _chunk7DJG5YVGcjs.runMarkdownPipeline.call(void 0, input, given);
|
|
19
19
|
}
|
|
20
20
|
function analyze(input, options) {
|
|
21
21
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
22
|
-
|
|
23
|
-
return
|
|
22
|
+
_chunkVNWEZQWPcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
|
|
23
|
+
return _chunk7DJG5YVGcjs.analyzeMarkdownPipeline.call(void 0, input, given);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
exports.PolytypoError =
|
|
29
|
+
exports.PolytypoError = _chunkAWTKVV4Ecjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
30
30
|
//# sourceMappingURL=markdown.cjs.map
|
package/dist/markdown.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeMarkdownPipeline,
|
|
3
3
|
runMarkdownPipeline
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-OQRJ5BMU.js";
|
|
5
|
+
import "./chunk-D5X53S7D.js";
|
|
6
|
+
import "./chunk-4ZRTKEZA.js";
|
|
7
7
|
import {
|
|
8
8
|
assertFixedMode
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DWQ3SDHS.js";
|
|
10
10
|
import {
|
|
11
11
|
PolytypoError
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BXENIIJD.js";
|
|
13
13
|
|
|
14
14
|
// src/index.markdown.ts
|
|
15
15
|
function transform(input, options) {
|
package/dist/text.cjs
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk4YXTHZIBcjs = require('./chunk-4YXTHZIB.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkVNWEZQWPcjs = require('./chunk-VNWEZQWP.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkAWTKVV4Ecjs = require('./chunk-AWTKVV4E.cjs');
|
|
11
11
|
|
|
12
12
|
// src/index.text.ts
|
|
13
13
|
function transform(input, options) {
|
|
14
14
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
15
|
-
|
|
16
|
-
return
|
|
15
|
+
_chunkVNWEZQWPcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
|
|
16
|
+
return _chunk4YXTHZIBcjs.runTextPipeline.call(void 0, input, given);
|
|
17
17
|
}
|
|
18
18
|
function analyze(input, options) {
|
|
19
19
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
20
|
-
|
|
21
|
-
return
|
|
20
|
+
_chunkVNWEZQWPcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
|
|
21
|
+
return _chunk4YXTHZIBcjs.analyzeTextPipeline.call(void 0, input, given);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
exports.PolytypoError =
|
|
27
|
+
exports.PolytypoError = _chunkAWTKVV4Ecjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
28
28
|
//# sourceMappingURL=text.cjs.map
|
package/dist/text.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeTextPipeline,
|
|
3
3
|
runTextPipeline
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-S7NXM2JK.js";
|
|
5
5
|
import {
|
|
6
6
|
assertFixedMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DWQ3SDHS.js";
|
|
8
8
|
import {
|
|
9
9
|
PolytypoError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BXENIIJD.js";
|
|
11
11
|
|
|
12
12
|
// src/index.text.ts
|
|
13
13
|
function transform(input, options) {
|
package/dist/yaml.cjs
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunkKZWW24OZcjs = require('./chunk-KZWW24OZ.cjs');
|
|
5
|
+
require('./chunk-LLKXGT4D.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkVNWEZQWPcjs = require('./chunk-VNWEZQWP.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkAWTKVV4Ecjs = require('./chunk-AWTKVV4E.cjs');
|
|
12
12
|
|
|
13
13
|
// src/index.yaml.ts
|
|
14
14
|
function transform(input, options) {
|
|
15
15
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
16
|
-
|
|
17
|
-
return
|
|
16
|
+
_chunkVNWEZQWPcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
|
|
17
|
+
return _chunkKZWW24OZcjs.runYamlPipeline.call(void 0, input, given);
|
|
18
18
|
}
|
|
19
19
|
function analyze(input, options) {
|
|
20
20
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
21
|
-
|
|
22
|
-
return
|
|
21
|
+
_chunkVNWEZQWPcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
|
|
22
|
+
return _chunkKZWW24OZcjs.analyzeYamlPipeline.call(void 0, input, given);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
exports.PolytypoError =
|
|
28
|
+
exports.PolytypoError = _chunkAWTKVV4Ecjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
29
29
|
//# sourceMappingURL=yaml.cjs.map
|
package/dist/yaml.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeYamlPipeline,
|
|
3
3
|
runYamlPipeline
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ZC2JQGJN.js";
|
|
5
|
+
import "./chunk-4ZRTKEZA.js";
|
|
6
6
|
import {
|
|
7
7
|
assertFixedMode
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DWQ3SDHS.js";
|
|
9
9
|
import {
|
|
10
10
|
PolytypoError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BXENIIJD.js";
|
|
12
12
|
|
|
13
13
|
// src/index.yaml.ts
|
|
14
14
|
function transform(input, options) {
|
package/package.json
CHANGED
package/dist/chunk-DBNA7GVR.cjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkPXBKWYVGcjs = require('./chunk-PXBKWYVG.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _chunkQGPUYIQ6cjs = require('./chunk-QGPUYIQ6.cjs');
|
|
12
|
-
|
|
13
|
-
// src/engine/html-pipeline.ts
|
|
14
|
-
function runHtmlPipeline(input, options) {
|
|
15
|
-
const narrowTarget = _chunkQGPUYIQ6cjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
16
|
-
const planned = _chunkQGPUYIQ6cjs.planRules.call(void 0, options.rules);
|
|
17
|
-
const locale = _chunkQGPUYIQ6cjs.getLocaleData.call(void 0, options.locale);
|
|
18
|
-
_chunkQGPUYIQ6cjs.assertNoProtect.call(void 0, options.protect, "html");
|
|
19
|
-
const spans = _chunkPXBKWYVGcjs.htmlSpans.call(void 0, input);
|
|
20
|
-
return _chunkQGPUYIQ6cjs.runOverSpans.call(void 0, input, spans, planned, locale, "html", narrowTarget);
|
|
21
|
-
}
|
|
22
|
-
function analyzeHtmlPipeline(input, options) {
|
|
23
|
-
const narrowTarget = _chunkQGPUYIQ6cjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
24
|
-
const planned = _chunkQGPUYIQ6cjs.planRules.call(void 0, options.rules);
|
|
25
|
-
const locale = _chunkQGPUYIQ6cjs.getLocaleData.call(void 0, options.locale);
|
|
26
|
-
_chunkQGPUYIQ6cjs.assertNoProtect.call(void 0, options.protect, "html");
|
|
27
|
-
return _chunkQGPUYIQ6cjs.analyzeOverSpans.call(void 0, input, _chunkPXBKWYVGcjs.htmlSpans.call(void 0, input), planned, locale, "html", narrowTarget);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
exports.runHtmlPipeline = runHtmlPipeline; exports.analyzeHtmlPipeline = analyzeHtmlPipeline;
|
|
34
|
-
//# sourceMappingURL=chunk-DBNA7GVR.cjs.map
|
package/dist/chunk-KH57BTH6.cjs
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkR6IILWU3cjs = require('./chunk-R6IILWU3.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _chunkQGPUYIQ6cjs = require('./chunk-QGPUYIQ6.cjs');
|
|
13
|
-
|
|
14
|
-
// src/engine/yaml-pipeline.ts
|
|
15
|
-
function runYamlPipeline(input, options) {
|
|
16
|
-
const narrowTarget = _chunkQGPUYIQ6cjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
17
|
-
const planned = _chunkQGPUYIQ6cjs.planRules.call(void 0, options.rules);
|
|
18
|
-
const locale = _chunkQGPUYIQ6cjs.getLocaleData.call(void 0, options.locale);
|
|
19
|
-
const keys = _chunkR6IILWU3cjs.resolveYamlKeys.call(void 0, options.keys);
|
|
20
|
-
_chunkQGPUYIQ6cjs.assertNoProtect.call(void 0, options.protect, "yaml");
|
|
21
|
-
return _chunkQGPUYIQ6cjs.runOverSpans.call(void 0, input, _chunkR6IILWU3cjs.yamlSpans.call(void 0, input, keys), planned, locale, "yaml", narrowTarget);
|
|
22
|
-
}
|
|
23
|
-
function analyzeYamlPipeline(input, options) {
|
|
24
|
-
const narrowTarget = _chunkQGPUYIQ6cjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
25
|
-
const planned = _chunkQGPUYIQ6cjs.planRules.call(void 0, options.rules);
|
|
26
|
-
const locale = _chunkQGPUYIQ6cjs.getLocaleData.call(void 0, options.locale);
|
|
27
|
-
const keys = _chunkR6IILWU3cjs.resolveYamlKeys.call(void 0, options.keys);
|
|
28
|
-
_chunkQGPUYIQ6cjs.assertNoProtect.call(void 0, options.protect, "yaml");
|
|
29
|
-
return _chunkQGPUYIQ6cjs.analyzeOverSpans.call(void 0, input, _chunkR6IILWU3cjs.yamlSpans.call(void 0, input, keys), planned, locale, "yaml", narrowTarget);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
exports.runYamlPipeline = runYamlPipeline; exports.analyzeYamlPipeline = analyzeYamlPipeline;
|
|
36
|
-
//# sourceMappingURL=chunk-KH57BTH6.cjs.map
|