polytypo 1.29.0 → 1.31.0

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.
Files changed (61) hide show
  1. package/README.md +9 -0
  2. package/dist/{chunk-Q23NSX5T.js → chunk-2EEO3SUH.js} +3 -3
  3. package/dist/{chunk-SMI5FQDC.js → chunk-2GDHU7YJ.js} +2 -2
  4. package/dist/{chunk-5NTTJKWN.cjs → chunk-4FDTU4LV.cjs} +6 -6
  5. package/dist/{chunk-5NTTJKWN.cjs.map → chunk-4FDTU4LV.cjs.map} +1 -1
  6. package/dist/{chunk-DGIQD3CL.cjs → chunk-4GW2ZMIG.cjs} +9 -7
  7. package/dist/chunk-4GW2ZMIG.cjs.map +1 -0
  8. package/dist/{chunk-VRFR4RLZ.js → chunk-7NSSCTBK.js} +3 -3
  9. package/dist/{chunk-TO4ONFOS.cjs → chunk-BFRFZXOI.cjs} +3 -3
  10. package/dist/{chunk-TO4ONFOS.cjs.map → chunk-BFRFZXOI.cjs.map} +1 -1
  11. package/dist/chunk-CFVUGAEQ.cjs +34 -0
  12. package/dist/{chunk-5X4EL2FZ.cjs.map → chunk-CFVUGAEQ.cjs.map} +1 -1
  13. package/dist/{chunk-46HVHDLD.js → chunk-CWHCIX7Q.js} +4 -4
  14. package/dist/{chunk-IAD2Z4LK.js → chunk-DNFGA3PK.js} +2 -2
  15. package/dist/{chunk-OW7RDXON.js → chunk-HY3GXZAZ.js} +3 -1
  16. package/dist/chunk-HY3GXZAZ.js.map +1 -0
  17. package/dist/chunk-JG33G4ZR.cjs +36 -0
  18. package/dist/{chunk-F6U75LDW.cjs.map → chunk-JG33G4ZR.cjs.map} +1 -1
  19. package/dist/{chunk-2DFXIIFM.js → chunk-LHDMQYVE.js} +6 -4
  20. package/dist/chunk-LHDMQYVE.js.map +1 -0
  21. package/dist/{chunk-6BEQTKTO.cjs → chunk-N5VKLPIT.cjs} +23 -23
  22. package/dist/{chunk-6BEQTKTO.cjs.map → chunk-N5VKLPIT.cjs.map} +1 -1
  23. package/dist/chunk-QOW2MY3I.cjs +38 -0
  24. package/dist/{chunk-CRSRFLXY.cjs.map → chunk-QOW2MY3I.cjs.map} +1 -1
  25. package/dist/{chunk-RM6623UN.cjs → chunk-TWPD6PZY.cjs} +3 -1
  26. package/dist/chunk-TWPD6PZY.cjs.map +1 -0
  27. package/dist/{chunk-SJTHHQVJ.js → chunk-YATDFC7V.js} +2 -2
  28. package/dist/html-BGFLg6_c.d.cts +10 -0
  29. package/dist/html-BGFLg6_c.d.ts +10 -0
  30. package/dist/html.cjs +12 -9
  31. package/dist/html.cjs.map +1 -1
  32. package/dist/html.d.cts +1 -0
  33. package/dist/html.d.ts +1 -0
  34. package/dist/html.js +7 -4
  35. package/dist/html.js.map +1 -1
  36. package/dist/index.cjs +20 -17
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +1 -0
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.js +10 -7
  41. package/dist/index.js.map +1 -1
  42. package/dist/markdown.cjs +10 -10
  43. package/dist/markdown.js +5 -5
  44. package/dist/text.cjs +8 -8
  45. package/dist/text.js +3 -3
  46. package/dist/yaml.cjs +9 -9
  47. package/dist/yaml.js +4 -4
  48. package/package.json +1 -1
  49. package/dist/chunk-2DFXIIFM.js.map +0 -1
  50. package/dist/chunk-5X4EL2FZ.cjs +0 -34
  51. package/dist/chunk-CRSRFLXY.cjs +0 -38
  52. package/dist/chunk-DGIQD3CL.cjs.map +0 -1
  53. package/dist/chunk-F6U75LDW.cjs +0 -36
  54. package/dist/chunk-OW7RDXON.js.map +0 -1
  55. package/dist/chunk-RM6623UN.cjs.map +0 -1
  56. /package/dist/{chunk-Q23NSX5T.js.map → chunk-2EEO3SUH.js.map} +0 -0
  57. /package/dist/{chunk-SMI5FQDC.js.map → chunk-2GDHU7YJ.js.map} +0 -0
  58. /package/dist/{chunk-VRFR4RLZ.js.map → chunk-7NSSCTBK.js.map} +0 -0
  59. /package/dist/{chunk-46HVHDLD.js.map → chunk-CWHCIX7Q.js.map} +0 -0
  60. /package/dist/{chunk-IAD2Z4LK.js.map → chunk-DNFGA3PK.js.map} +0 -0
  61. /package/dist/{chunk-SJTHHQVJ.js.map → chunk-YATDFC7V.js.map} +0 -0
@@ -9,7 +9,7 @@ import {
9
9
  runRules,
10
10
  runRulesRecording,
11
11
  toCodePoints
12
- } from "./chunk-OW7RDXON.js";
12
+ } from "./chunk-HY3GXZAZ.js";
13
13
 
14
14
  // src/engine/text-pipeline.ts
15
15
  function runTextPipeline(input, options) {
@@ -35,4 +35,4 @@ export {
35
35
  runTextPipeline,
36
36
  analyzeTextPipeline
37
37
  };
38
- //# sourceMappingURL=chunk-SJTHHQVJ.js.map
38
+ //# sourceMappingURL=chunk-YATDFC7V.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * spec/rules/modes.md 3.6, exhaustive and **closed**: extending it is a spec change, not an
3
+ * implementation decision. `svg` and `math` are here because in MathML a quotation mark, a
4
+ * hyphen and a prime are operators and identifiers — substituting a curly glyph changes what
5
+ * the expression means. Everything not listed is processable, **including unknown and custom
6
+ * elements**: guessing from a tag name is exactly the heuristic that diverges across runtimes.
7
+ */
8
+ declare const SKIPPED_ELEMENTS: readonly string[];
9
+
10
+ export { SKIPPED_ELEMENTS as S };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * spec/rules/modes.md 3.6, exhaustive and **closed**: extending it is a spec change, not an
3
+ * implementation decision. `svg` and `math` are here because in MathML a quotation mark, a
4
+ * hyphen and a prime are operators and identifiers — substituting a curly glyph changes what
5
+ * the expression means. Everything not listed is processable, **including unknown and custom
6
+ * elements**: guessing from a tag name is exactly the heuristic that diverges across runtimes.
7
+ */
8
+ declare const SKIPPED_ELEMENTS: readonly string[];
9
+
10
+ export { SKIPPED_ELEMENTS as S };
package/dist/html.cjs CHANGED
@@ -1,29 +1,32 @@
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 _chunk5X4EL2FZcjs = require('./chunk-5X4EL2FZ.cjs');
5
- require('./chunk-DGIQD3CL.cjs');
4
+ var _chunkCFVUGAEQcjs = require('./chunk-CFVUGAEQ.cjs');
6
5
 
7
6
 
8
- var _chunkTO4ONFOScjs = require('./chunk-TO4ONFOS.cjs');
7
+ var _chunk4GW2ZMIGcjs = require('./chunk-4GW2ZMIG.cjs');
9
8
 
10
9
 
11
- var _chunkRM6623UNcjs = require('./chunk-RM6623UN.cjs');
10
+ var _chunkBFRFZXOIcjs = require('./chunk-BFRFZXOI.cjs');
11
+
12
+
13
+ var _chunkTWPD6PZYcjs = require('./chunk-TWPD6PZY.cjs');
12
14
 
13
15
  // src/index.html.ts
14
16
  function transform(input, options) {
15
17
  const given = _nullishCoalesce(options, () => ( {}));
16
- _chunkTO4ONFOScjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
17
- return _chunk5X4EL2FZcjs.runHtmlPipeline.call(void 0, input, given);
18
+ _chunkBFRFZXOIcjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
19
+ return _chunkCFVUGAEQcjs.runHtmlPipeline.call(void 0, input, given);
18
20
  }
19
21
  function analyze(input, options) {
20
22
  const given = _nullishCoalesce(options, () => ( {}));
21
- _chunkTO4ONFOScjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
22
- return _chunk5X4EL2FZcjs.analyzeHtmlPipeline.call(void 0, input, given);
23
+ _chunkBFRFZXOIcjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
24
+ return _chunkCFVUGAEQcjs.analyzeHtmlPipeline.call(void 0, input, given);
23
25
  }
24
26
 
25
27
 
26
28
 
27
29
 
28
- exports.PolytypoError = _chunkRM6623UNcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
30
+
31
+ exports.PolytypoError = _chunkTWPD6PZYcjs.PolytypoError; exports.SKIPPED_ELEMENTS = _chunk4GW2ZMIGcjs.SKIPPED_ELEMENTS; exports.analyze = analyze; exports.transform = transform;
29
32
  //# sourceMappingURL=html.cjs.map
package/dist/html.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/html.cjs","../src/index.html.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACIO,SAAS,SAAA,CAAU,KAAA,EAAe,OAAA,EAA8B;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,+CAAA,KAAgB,EAAO,KAAK,CAAA;AACrC;AAOO,SAAS,OAAA,CAAQ,KAAA,EAAe,OAAA,EAAgC;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,mDAAA,KAAoB,EAAO,KAAK,CAAA;AACzC;ADRA;AACE;AACA;AACA;AACF,kHAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/html.cjs","sourcesContent":[null,"import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeHtmlPipeline, runHtmlPipeline } from \"./engine/html-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/html` — HTML-only entry point. Its module graph includes `parse5` but excludes the\n * Micromark/MDX stack (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/html-pipeline.js` directly and never `./engine/pipeline.js` or `./modes/markdown.js`.\n *\n * `mode` is absent from `HtmlOptions`, since this entry only ever runs `html` mode. `dialect` is\n * likewise absent — it has no effect in `html` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type HtmlOptions = Omit<Options, \"mode\" | \"dialect\" | \"frontmatterKeys\" | \"protect\">;\n\nexport function transform(input: string, options: HtmlOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"html\", \"polytypo/html\");\n return runHtmlPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` — into the document,\n * not into a span (analyze.md §6).\n */\nexport function analyze(input: string, options: HtmlOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"html\", \"polytypo/html\");\n return analyzeHtmlPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"]}
1
+ {"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/html.cjs","../src/index.html.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACEO,SAAS,SAAA,CAAU,KAAA,EAAe,OAAA,EAA8B;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,+CAAA,KAAgB,EAAO,KAAK,CAAA;AACrC;AAOO,SAAS,OAAA,CAAQ,KAAA,EAAe,OAAA,EAAgC;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,mDAAA,KAAoB,EAAO,KAAK,CAAA;AACzC;ADNA;AACE;AACA;AACA;AACA;AACF,iLAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/html.cjs","sourcesContent":[null,"import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeHtmlPipeline, runHtmlPipeline } from \"./engine/html-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/html` — HTML-only entry point. Its module graph includes `parse5` but excludes the\n * Micromark/MDX stack (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/html-pipeline.js` directly and never `./engine/pipeline.js` or `./modes/markdown.js`.\n *\n * `mode` is absent from `HtmlOptions`, since this entry only ever runs `html` mode. `dialect` is\n * likewise absent — it has no effect in `html` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type HtmlOptions = Omit<Options, \"mode\" | \"dialect\" | \"frontmatterKeys\" | \"protect\">;\n\nexport function transform(input: string, options: HtmlOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"html\", \"polytypo/html\");\n return runHtmlPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` — into the document,\n * not into a span (analyze.md §6).\n */\nexport function analyze(input: string, options: HtmlOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"html\", \"polytypo/html\");\n return analyzeHtmlPipeline(input, given);\n}\n\nexport { SKIPPED_ELEMENTS } from \"./modes/html.js\";\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"]}
package/dist/html.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { O as Options, C as Change } from './errors-C5bXmTWu.cjs';
2
2
  export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-C5bXmTWu.cjs';
3
+ export { S as SKIPPED_ELEMENTS } from './html-BGFLg6_c.cjs';
3
4
 
4
5
  /**
5
6
  * `polytypo/html` — HTML-only entry point. Its module graph includes `parse5` but excludes the
package/dist/html.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { O as Options, C as Change } from './errors-C5bXmTWu.js';
2
2
  export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-C5bXmTWu.js';
3
+ export { S as SKIPPED_ELEMENTS } from './html-BGFLg6_c.js';
3
4
 
4
5
  /**
5
6
  * `polytypo/html` — HTML-only entry point. Its module graph includes `parse5` but excludes the
package/dist/html.js CHANGED
@@ -1,14 +1,16 @@
1
1
  import {
2
2
  analyzeHtmlPipeline,
3
3
  runHtmlPipeline
4
- } from "./chunk-VRFR4RLZ.js";
5
- import "./chunk-2DFXIIFM.js";
4
+ } from "./chunk-7NSSCTBK.js";
5
+ import {
6
+ SKIPPED_ELEMENTS
7
+ } from "./chunk-LHDMQYVE.js";
6
8
  import {
7
9
  assertFixedMode
8
- } from "./chunk-IAD2Z4LK.js";
10
+ } from "./chunk-DNFGA3PK.js";
9
11
  import {
10
12
  PolytypoError
11
- } from "./chunk-OW7RDXON.js";
13
+ } from "./chunk-HY3GXZAZ.js";
12
14
 
13
15
  // src/index.html.ts
14
16
  function transform(input, options) {
@@ -23,6 +25,7 @@ function analyze(input, options) {
23
25
  }
24
26
  export {
25
27
  PolytypoError,
28
+ SKIPPED_ELEMENTS,
26
29
  analyze,
27
30
  transform
28
31
  };
package/dist/html.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.html.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeHtmlPipeline, runHtmlPipeline } from \"./engine/html-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/html` — HTML-only entry point. Its module graph includes `parse5` but excludes the\n * Micromark/MDX stack (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/html-pipeline.js` directly and never `./engine/pipeline.js` or `./modes/markdown.js`.\n *\n * `mode` is absent from `HtmlOptions`, since this entry only ever runs `html` mode. `dialect` is\n * likewise absent — it has no effect in `html` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type HtmlOptions = Omit<Options, \"mode\" | \"dialect\" | \"frontmatterKeys\" | \"protect\">;\n\nexport function transform(input: string, options: HtmlOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"html\", \"polytypo/html\");\n return runHtmlPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` — into the document,\n * not into a span (analyze.md §6).\n */\nexport function analyze(input: string, options: HtmlOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"html\", \"polytypo/html\");\n return analyzeHtmlPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;;AAgBO,SAAS,UAAU,OAAe,SAA8B;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,gBAAgB,OAAO,KAAK;AACrC;AAOO,SAAS,QAAQ,OAAe,SAAgC;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,oBAAoB,OAAO,KAAK;AACzC;","names":[]}
1
+ {"version":3,"sources":["../src/index.html.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeHtmlPipeline, runHtmlPipeline } from \"./engine/html-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/html` — HTML-only entry point. Its module graph includes `parse5` but excludes the\n * Micromark/MDX stack (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/html-pipeline.js` directly and never `./engine/pipeline.js` or `./modes/markdown.js`.\n *\n * `mode` is absent from `HtmlOptions`, since this entry only ever runs `html` mode. `dialect` is\n * likewise absent — it has no effect in `html` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type HtmlOptions = Omit<Options, \"mode\" | \"dialect\" | \"frontmatterKeys\" | \"protect\">;\n\nexport function transform(input: string, options: HtmlOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"html\", \"polytypo/html\");\n return runHtmlPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` — into the document,\n * not into a span (analyze.md §6).\n */\nexport function analyze(input: string, options: HtmlOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"html\", \"polytypo/html\");\n return analyzeHtmlPipeline(input, given);\n}\n\nexport { SKIPPED_ELEMENTS } from \"./modes/html.js\";\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;;;;AAgBO,SAAS,UAAU,OAAe,SAA8B;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,gBAAgB,OAAO,KAAK;AACrC;AAOO,SAAS,QAAQ,OAAe,SAAgC;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,oBAAoB,OAAO,KAAK;AACzC;","names":[]}
package/dist/index.cjs CHANGED
@@ -1,30 +1,32 @@
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 _chunkCRSRFLXYcjs = require('./chunk-CRSRFLXY.cjs');
4
+ var _chunkQOW2MY3Icjs = require('./chunk-QOW2MY3I.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunk5X4EL2FZcjs = require('./chunk-5X4EL2FZ.cjs');
8
+ var _chunkCFVUGAEQcjs = require('./chunk-CFVUGAEQ.cjs');
9
9
 
10
10
 
11
11
 
12
- var _chunk6BEQTKTOcjs = require('./chunk-6BEQTKTO.cjs');
13
- require('./chunk-DGIQD3CL.cjs');
12
+ var _chunkN5VKLPITcjs = require('./chunk-N5VKLPIT.cjs');
14
13
 
15
14
 
15
+ var _chunk4GW2ZMIGcjs = require('./chunk-4GW2ZMIG.cjs');
16
16
 
17
- var _chunkF6U75LDWcjs = require('./chunk-F6U75LDW.cjs');
18
- require('./chunk-5NTTJKWN.cjs');
19
17
 
20
18
 
21
- var _chunkRM6623UNcjs = require('./chunk-RM6623UN.cjs');
19
+ var _chunkJG33G4ZRcjs = require('./chunk-JG33G4ZR.cjs');
20
+ require('./chunk-4FDTU4LV.cjs');
21
+
22
+
23
+ var _chunkTWPD6PZYcjs = require('./chunk-TWPD6PZY.cjs');
22
24
 
23
25
  // src/engine/pipeline.ts
24
26
  function resolveMode(mode) {
25
27
  if (mode === void 0 || mode === "text") return "text";
26
28
  if (mode === "html" || mode === "markdown" || mode === "yaml") return mode;
27
- throw new (0, _chunkRM6623UNcjs.PolytypoError)(
29
+ throw new (0, _chunkTWPD6PZYcjs.PolytypoError)(
28
30
  "POLYTYPO_INVALID_MODE",
29
31
  `Unknown mode "${String(mode)}". Expected "text", "html", "markdown" or "yaml".`
30
32
  );
@@ -32,18 +34,18 @@ function resolveMode(mode) {
32
34
  function runPipeline(input, options) {
33
35
  const given = _nullishCoalesce(options, () => ( {}));
34
36
  const mode = resolveMode(given.mode);
35
- if (mode === "text") return _chunkCRSRFLXYcjs.runTextPipeline.call(void 0, input, given);
36
- if (mode === "html") return _chunk5X4EL2FZcjs.runHtmlPipeline.call(void 0, input, given);
37
- if (mode === "yaml") return _chunkF6U75LDWcjs.runYamlPipeline.call(void 0, input, given);
38
- return _chunk6BEQTKTOcjs.runMarkdownPipeline.call(void 0, input, given);
37
+ if (mode === "text") return _chunkQOW2MY3Icjs.runTextPipeline.call(void 0, input, given);
38
+ if (mode === "html") return _chunkCFVUGAEQcjs.runHtmlPipeline.call(void 0, input, given);
39
+ if (mode === "yaml") return _chunkJG33G4ZRcjs.runYamlPipeline.call(void 0, input, given);
40
+ return _chunkN5VKLPITcjs.runMarkdownPipeline.call(void 0, input, given);
39
41
  }
40
42
  function runAnalyze(input, options) {
41
43
  const given = _nullishCoalesce(options, () => ( {}));
42
44
  const mode = resolveMode(given.mode);
43
- if (mode === "text") return _chunkCRSRFLXYcjs.analyzeTextPipeline.call(void 0, input, given);
44
- if (mode === "html") return _chunk5X4EL2FZcjs.analyzeHtmlPipeline.call(void 0, input, given);
45
- if (mode === "yaml") return _chunkF6U75LDWcjs.analyzeYamlPipeline.call(void 0, input, given);
46
- return _chunk6BEQTKTOcjs.analyzeMarkdownPipeline.call(void 0, input, given);
45
+ if (mode === "text") return _chunkQOW2MY3Icjs.analyzeTextPipeline.call(void 0, input, given);
46
+ if (mode === "html") return _chunkCFVUGAEQcjs.analyzeHtmlPipeline.call(void 0, input, given);
47
+ if (mode === "yaml") return _chunkJG33G4ZRcjs.analyzeYamlPipeline.call(void 0, input, given);
48
+ return _chunkN5VKLPITcjs.analyzeMarkdownPipeline.call(void 0, input, given);
47
49
  }
48
50
 
49
51
  // src/index.ts
@@ -57,5 +59,6 @@ function analyze(input, options) {
57
59
 
58
60
 
59
61
 
60
- exports.PolytypoError = _chunkRM6623UNcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
62
+
63
+ exports.PolytypoError = _chunkTWPD6PZYcjs.PolytypoError; exports.SKIPPED_ELEMENTS = _chunk4GW2ZMIGcjs.SKIPPED_ELEMENTS; exports.analyze = analyze; exports.transform = transform;
61
64
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/index.cjs","../src/engine/pipeline.ts","../src/index.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACZA,SAAS,WAAA,CAAY,IAAA,EAA8B;AACjD,EAAA,GAAA,CAAI,KAAA,IAAS,KAAA,EAAA,GAAa,KAAA,IAAS,MAAA,EAAQ,OAAO,MAAA;AAClD,EAAA,GAAA,CAAI,KAAA,IAAS,OAAA,GAAU,KAAA,IAAS,WAAA,GAAc,KAAA,IAAS,MAAA,EAAQ,OAAO,IAAA;AACtE,EAAA,MAAM,IAAI,oCAAA;AAAA,IACR,uBAAA;AAAA,IACA,CAAA,cAAA,EAAiB,MAAA,CAAO,IAAI,CAAC,CAAA,iDAAA;AAAA,EAC/B,CAAA;AACF;AASO,SAAS,WAAA,CAAY,KAAA,E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/runner/work/polytypo-js/polytypo-js/dist/index.cjs","sourcesContent":[null,"import { PolytypoError } from \"../errors.js\";\nimport type { Mode, Options } from \"../types.js\";\nimport { analyzeHtmlPipeline, runHtmlPipeline } from \"./html-pipeline.js\";\nimport { analyzeMarkdownPipeline, runMarkdownPipeline } from \"./markdown-pipeline.js\";\nimport { analyzeTextPipeline, runTextPipeline } from \"./text-pipeline.js\";\nimport { analyzeYamlPipeline, runYamlPipeline } from \"./yaml-pipeline.js\";\nimport type { Change } from \"./origin.js\";\n\nexport { planRules } from \"./rule-runner.js\";\n\nfunction resolveMode(mode: Mode | undefined): Mode {\n if (mode === undefined || mode === \"text\") return \"text\";\n if (mode === \"html\" || mode === \"markdown\" || mode === \"yaml\") return mode;\n throw new PolytypoError(\n \"POLYTYPO_INVALID_MODE\",\n `Unknown mode \"${String(mode)}\". Expected \"text\", \"html\", \"markdown\" or \"yaml\".`,\n );\n}\n\n/**\n * The aggregate entry's dispatcher: every mode is reachable, so it is the only pipeline module\n * that imports all four mode-specific ones (and therefore the only one whose module graph\n * includes both `parse5` and the Micromark/MDX stack). `polytypo/text`, `polytypo/html` and\n * `polytypo/markdown` each call their own mode-specific pipeline directly and never import this\n * module (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1).\n */\nexport function runPipeline(input: string, options: Options): string {\n // A plain-JS caller can omit the options object entirely. Reading through a null here would\n // raise a native TypeError, which is outside the error taxonomy; an absent `locale` is an\n // unknown locale and must say so with a code (locale-resolution.md 3.1).\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return runTextPipeline(input, given);\n if (mode === \"html\") return runHtmlPipeline(input, given);\n if (mode === \"yaml\") return runYamlPipeline(input, given);\n return runMarkdownPipeline(input, given);\n}\n\n/**\n * The dispatcher for `analyze` (analyze.md §1). Mode resolution, and therefore\n * POLYTYPO_INVALID_MODE, is shared with `runPipeline` rather than duplicated: A1 requires the\n * two entry points to accept and reject exactly the same arguments.\n */\nexport function runAnalyze(input: string, options: Options): Change[] {\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return analyzeTextPipeline(input, given);\n if (mode === \"html\") return analyzeHtmlPipeline(input, given);\n if (mode === \"yaml\") return analyzeYamlPipeline(input, given);\n return analyzeMarkdownPipeline(input, given);\n}\n","import { runAnalyze, runPipeline } from \"./engine/pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\nexport function transform(input: string, options: Options): string {\n return runPipeline(input, options);\n}\n\n/**\n * The same pipeline as `transform`, reporting what it would do instead of doing it\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` in every mode.\n *\n * What it guarantees: the list is empty exactly when `transform` would return the input\n * unchanged, every `ruleId` was enabled for the call, and every offset is inside the input.\n * What it does not: the list is a report, not a patch — two rules may touch the same original\n * range, so replaying it is not guaranteed to reproduce `transform`'s output. Call `transform`\n * for the text (analyze.md §4, §5).\n */\nexport function analyze(input: string, options: Options): Change[] {\n return runAnalyze(input, options);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type {\n Dialect,\n Edit,\n LocaleData,\n LocaleSource,\n Mode,\n NarrowNbsp,\n Options,\n ProtectRange,\n QuotePair,\n Rule,\n RuleContext,\n RuleId,\n} from \"./types.js\";\n"]}
1
+ {"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/index.cjs","../src/engine/pipeline.ts","../src/index.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACdA,SAAS,WAAA,CAAY,IAAA,EAA8B;AACjD,EAAA,GAAA,CAAI,KAAA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KAAK,CAAA;AAC5D,EAAA,OAAO,uDAAA,KAAwB,EAAO,KAAK,CAAA;AAC7C;ADDA;AACA;AE9CO,SAAS,SAAA,CAAU,KAAA,EAAe,OAAA,EAA0B;AACjE,EAAA,OAAO,WAAA,CAAY,KAAA,EAAO,OAAO,CAAA;AACnC;AAYO,SAAS,OAAA,CAAQ,KAAA,EAAe,OAAA,EAA4B;AACjE,EAAA,OAAO,UAAA,CAAW,KAAA,EAAO,OAAO,CAAA;AAClC;AFqCA;AACE;AACA;AACA;AACA;AACF,iLAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/index.cjs","sourcesContent":[null,"import { PolytypoError } from \"../errors.js\";\nimport type { Mode, Options } from \"../types.js\";\nimport { analyzeHtmlPipeline, runHtmlPipeline } from \"./html-pipeline.js\";\nimport { analyzeMarkdownPipeline, runMarkdownPipeline } from \"./markdown-pipeline.js\";\nimport { analyzeTextPipeline, runTextPipeline } from \"./text-pipeline.js\";\nimport { analyzeYamlPipeline, runYamlPipeline } from \"./yaml-pipeline.js\";\nimport type { Change } from \"./origin.js\";\n\nexport { planRules } from \"./rule-runner.js\";\n\nfunction resolveMode(mode: Mode | undefined): Mode {\n if (mode === undefined || mode === \"text\") return \"text\";\n if (mode === \"html\" || mode === \"markdown\" || mode === \"yaml\") return mode;\n throw new PolytypoError(\n \"POLYTYPO_INVALID_MODE\",\n `Unknown mode \"${String(mode)}\". Expected \"text\", \"html\", \"markdown\" or \"yaml\".`,\n );\n}\n\n/**\n * The aggregate entry's dispatcher: every mode is reachable, so it is the only pipeline module\n * that imports all four mode-specific ones (and therefore the only one whose module graph\n * includes both `parse5` and the Micromark/MDX stack). `polytypo/text`, `polytypo/html` and\n * `polytypo/markdown` each call their own mode-specific pipeline directly and never import this\n * module (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1).\n */\nexport function runPipeline(input: string, options: Options): string {\n // A plain-JS caller can omit the options object entirely. Reading through a null here would\n // raise a native TypeError, which is outside the error taxonomy; an absent `locale` is an\n // unknown locale and must say so with a code (locale-resolution.md 3.1).\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return runTextPipeline(input, given);\n if (mode === \"html\") return runHtmlPipeline(input, given);\n if (mode === \"yaml\") return runYamlPipeline(input, given);\n return runMarkdownPipeline(input, given);\n}\n\n/**\n * The dispatcher for `analyze` (analyze.md §1). Mode resolution, and therefore\n * POLYTYPO_INVALID_MODE, is shared with `runPipeline` rather than duplicated: A1 requires the\n * two entry points to accept and reject exactly the same arguments.\n */\nexport function runAnalyze(input: string, options: Options): Change[] {\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return analyzeTextPipeline(input, given);\n if (mode === \"html\") return analyzeHtmlPipeline(input, given);\n if (mode === \"yaml\") return analyzeYamlPipeline(input, given);\n return analyzeMarkdownPipeline(input, given);\n}\n","import { runAnalyze, runPipeline } from \"./engine/pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\nexport function transform(input: string, options: Options): string {\n return runPipeline(input, options);\n}\n\n/**\n * The same pipeline as `transform`, reporting what it would do instead of doing it\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` in every mode.\n *\n * What it guarantees: the list is empty exactly when `transform` would return the input\n * unchanged, every `ruleId` was enabled for the call, and every offset is inside the input.\n * What it does not: the list is a report, not a patch — two rules may touch the same original\n * range, so replaying it is not guaranteed to reproduce `transform`'s output. Call `transform`\n * for the text (analyze.md §4, §5).\n */\nexport function analyze(input: string, options: Options): Change[] {\n return runAnalyze(input, options);\n}\n\nexport { SKIPPED_ELEMENTS } from \"./modes/html.js\";\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type {\n Dialect,\n Edit,\n LocaleData,\n LocaleSource,\n Mode,\n NarrowNbsp,\n Options,\n ProtectRange,\n QuotePair,\n Rule,\n RuleContext,\n RuleId,\n} from \"./types.js\";\n"]}
package/dist/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { O as Options, C as Change } from './errors-C5bXmTWu.cjs';
2
2
  export { D as Dialect, E as Edit, L as LocaleData, a as LocaleSource, M as Mode, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-C5bXmTWu.cjs';
3
+ export { S as SKIPPED_ELEMENTS } from './html-BGFLg6_c.cjs';
3
4
 
4
5
  declare function transform(input: string, options: Options): string;
5
6
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { O as Options, C as Change } from './errors-C5bXmTWu.js';
2
2
  export { D as Dialect, E as Edit, L as LocaleData, a as LocaleSource, M as Mode, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-C5bXmTWu.js';
3
+ export { S as SKIPPED_ELEMENTS } from './html-BGFLg6_c.js';
3
4
 
4
5
  declare function transform(input: string, options: Options): string;
5
6
  /**
package/dist/index.js CHANGED
@@ -1,24 +1,26 @@
1
1
  import {
2
2
  analyzeTextPipeline,
3
3
  runTextPipeline
4
- } from "./chunk-SJTHHQVJ.js";
4
+ } from "./chunk-YATDFC7V.js";
5
5
  import {
6
6
  analyzeHtmlPipeline,
7
7
  runHtmlPipeline
8
- } from "./chunk-VRFR4RLZ.js";
8
+ } from "./chunk-7NSSCTBK.js";
9
9
  import {
10
10
  analyzeMarkdownPipeline,
11
11
  runMarkdownPipeline
12
- } from "./chunk-46HVHDLD.js";
13
- import "./chunk-2DFXIIFM.js";
12
+ } from "./chunk-CWHCIX7Q.js";
13
+ import {
14
+ SKIPPED_ELEMENTS
15
+ } from "./chunk-LHDMQYVE.js";
14
16
  import {
15
17
  analyzeYamlPipeline,
16
18
  runYamlPipeline
17
- } from "./chunk-Q23NSX5T.js";
18
- import "./chunk-SMI5FQDC.js";
19
+ } from "./chunk-2EEO3SUH.js";
20
+ import "./chunk-2GDHU7YJ.js";
19
21
  import {
20
22
  PolytypoError
21
- } from "./chunk-OW7RDXON.js";
23
+ } from "./chunk-HY3GXZAZ.js";
22
24
 
23
25
  // src/engine/pipeline.ts
24
26
  function resolveMode(mode) {
@@ -55,6 +57,7 @@ function analyze(input, options) {
55
57
  }
56
58
  export {
57
59
  PolytypoError,
60
+ SKIPPED_ELEMENTS,
58
61
  analyze,
59
62
  transform
60
63
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/engine/pipeline.ts","../src/index.ts"],"sourcesContent":["import { PolytypoError } from \"../errors.js\";\nimport type { Mode, Options } from \"../types.js\";\nimport { analyzeHtmlPipeline, runHtmlPipeline } from \"./html-pipeline.js\";\nimport { analyzeMarkdownPipeline, runMarkdownPipeline } from \"./markdown-pipeline.js\";\nimport { analyzeTextPipeline, runTextPipeline } from \"./text-pipeline.js\";\nimport { analyzeYamlPipeline, runYamlPipeline } from \"./yaml-pipeline.js\";\nimport type { Change } from \"./origin.js\";\n\nexport { planRules } from \"./rule-runner.js\";\n\nfunction resolveMode(mode: Mode | undefined): Mode {\n if (mode === undefined || mode === \"text\") return \"text\";\n if (mode === \"html\" || mode === \"markdown\" || mode === \"yaml\") return mode;\n throw new PolytypoError(\n \"POLYTYPO_INVALID_MODE\",\n `Unknown mode \"${String(mode)}\". Expected \"text\", \"html\", \"markdown\" or \"yaml\".`,\n );\n}\n\n/**\n * The aggregate entry's dispatcher: every mode is reachable, so it is the only pipeline module\n * that imports all four mode-specific ones (and therefore the only one whose module graph\n * includes both `parse5` and the Micromark/MDX stack). `polytypo/text`, `polytypo/html` and\n * `polytypo/markdown` each call their own mode-specific pipeline directly and never import this\n * module (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1).\n */\nexport function runPipeline(input: string, options: Options): string {\n // A plain-JS caller can omit the options object entirely. Reading through a null here would\n // raise a native TypeError, which is outside the error taxonomy; an absent `locale` is an\n // unknown locale and must say so with a code (locale-resolution.md 3.1).\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return runTextPipeline(input, given);\n if (mode === \"html\") return runHtmlPipeline(input, given);\n if (mode === \"yaml\") return runYamlPipeline(input, given);\n return runMarkdownPipeline(input, given);\n}\n\n/**\n * The dispatcher for `analyze` (analyze.md §1). Mode resolution, and therefore\n * POLYTYPO_INVALID_MODE, is shared with `runPipeline` rather than duplicated: A1 requires the\n * two entry points to accept and reject exactly the same arguments.\n */\nexport function runAnalyze(input: string, options: Options): Change[] {\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return analyzeTextPipeline(input, given);\n if (mode === \"html\") return analyzeHtmlPipeline(input, given);\n if (mode === \"yaml\") return analyzeYamlPipeline(input, given);\n return analyzeMarkdownPipeline(input, given);\n}\n","import { runAnalyze, runPipeline } from \"./engine/pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\nexport function transform(input: string, options: Options): string {\n return runPipeline(input, options);\n}\n\n/**\n * The same pipeline as `transform`, reporting what it would do instead of doing it\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` in every mode.\n *\n * What it guarantees: the list is empty exactly when `transform` would return the input\n * unchanged, every `ruleId` was enabled for the call, and every offset is inside the input.\n * What it does not: the list is a report, not a patch — two rules may touch the same original\n * range, so replaying it is not guaranteed to reproduce `transform`'s output. Call `transform`\n * for the text (analyze.md §4, §5).\n */\nexport function analyze(input: string, options: Options): Change[] {\n return runAnalyze(input, options);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type {\n Dialect,\n Edit,\n LocaleData,\n LocaleSource,\n Mode,\n NarrowNbsp,\n Options,\n ProtectRange,\n QuotePair,\n Rule,\n RuleContext,\n RuleId,\n} from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,YAAY,MAA8B;AACjD,MAAI,SAAS,UAAa,SAAS,OAAQ,QAAO;AAClD,MAAI,SAAS,UAAU,SAAS,cAAc,SAAS,OAAQ,QAAO;AACtE,QAAM,IAAI;AAAA,IACR;AAAA,IACA,iBAAiB,OAAO,IAAI,CAAC;AAAA,EAC/B;AACF;AASO,SAAS,YAAY,OAAe,SAA0B;AAInE,QAAM,QAA0B,WAAW,CAAC;AAC5C,QAAM,OAAO,YAAY,MAAM,IAAI;AACnC,MAAI,SAAS,OAAQ,QAAO,gBAAgB,OAAO,KAAK;AACxD,MAAI,SAAS,OAAQ,QAAO,gBAAgB,OAAO,KAAK;AACxD,MAAI,SAAS,OAAQ,QAAO,gBAAgB,OAAO,KAAK;AACxD,SAAO,oBAAoB,OAAO,KAAK;AACzC;AAOO,SAAS,WAAW,OAAe,SAA4B;AACpE,QAAM,QAA0B,WAAW,CAAC;AAC5C,QAAM,OAAO,YAAY,MAAM,IAAI;AACnC,MAAI,SAAS,OAAQ,QAAO,oBAAoB,OAAO,KAAK;AAC5D,MAAI,SAAS,OAAQ,QAAO,oBAAoB,OAAO,KAAK;AAC5D,MAAI,SAAS,OAAQ,QAAO,oBAAoB,OAAO,KAAK;AAC5D,SAAO,wBAAwB,OAAO,KAAK;AAC7C;;;AC9CO,SAAS,UAAU,OAAe,SAA0B;AACjE,SAAO,YAAY,OAAO,OAAO;AACnC;AAYO,SAAS,QAAQ,OAAe,SAA4B;AACjE,SAAO,WAAW,OAAO,OAAO;AAClC;","names":[]}
1
+ {"version":3,"sources":["../src/engine/pipeline.ts","../src/index.ts"],"sourcesContent":["import { PolytypoError } from \"../errors.js\";\nimport type { Mode, Options } from \"../types.js\";\nimport { analyzeHtmlPipeline, runHtmlPipeline } from \"./html-pipeline.js\";\nimport { analyzeMarkdownPipeline, runMarkdownPipeline } from \"./markdown-pipeline.js\";\nimport { analyzeTextPipeline, runTextPipeline } from \"./text-pipeline.js\";\nimport { analyzeYamlPipeline, runYamlPipeline } from \"./yaml-pipeline.js\";\nimport type { Change } from \"./origin.js\";\n\nexport { planRules } from \"./rule-runner.js\";\n\nfunction resolveMode(mode: Mode | undefined): Mode {\n if (mode === undefined || mode === \"text\") return \"text\";\n if (mode === \"html\" || mode === \"markdown\" || mode === \"yaml\") return mode;\n throw new PolytypoError(\n \"POLYTYPO_INVALID_MODE\",\n `Unknown mode \"${String(mode)}\". Expected \"text\", \"html\", \"markdown\" or \"yaml\".`,\n );\n}\n\n/**\n * The aggregate entry's dispatcher: every mode is reachable, so it is the only pipeline module\n * that imports all four mode-specific ones (and therefore the only one whose module graph\n * includes both `parse5` and the Micromark/MDX stack). `polytypo/text`, `polytypo/html` and\n * `polytypo/markdown` each call their own mode-specific pipeline directly and never import this\n * module (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1).\n */\nexport function runPipeline(input: string, options: Options): string {\n // A plain-JS caller can omit the options object entirely. Reading through a null here would\n // raise a native TypeError, which is outside the error taxonomy; an absent `locale` is an\n // unknown locale and must say so with a code (locale-resolution.md 3.1).\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return runTextPipeline(input, given);\n if (mode === \"html\") return runHtmlPipeline(input, given);\n if (mode === \"yaml\") return runYamlPipeline(input, given);\n return runMarkdownPipeline(input, given);\n}\n\n/**\n * The dispatcher for `analyze` (analyze.md §1). Mode resolution, and therefore\n * POLYTYPO_INVALID_MODE, is shared with `runPipeline` rather than duplicated: A1 requires the\n * two entry points to accept and reject exactly the same arguments.\n */\nexport function runAnalyze(input: string, options: Options): Change[] {\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return analyzeTextPipeline(input, given);\n if (mode === \"html\") return analyzeHtmlPipeline(input, given);\n if (mode === \"yaml\") return analyzeYamlPipeline(input, given);\n return analyzeMarkdownPipeline(input, given);\n}\n","import { runAnalyze, runPipeline } from \"./engine/pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\nexport function transform(input: string, options: Options): string {\n return runPipeline(input, options);\n}\n\n/**\n * The same pipeline as `transform`, reporting what it would do instead of doing it\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` in every mode.\n *\n * What it guarantees: the list is empty exactly when `transform` would return the input\n * unchanged, every `ruleId` was enabled for the call, and every offset is inside the input.\n * What it does not: the list is a report, not a patch — two rules may touch the same original\n * range, so replaying it is not guaranteed to reproduce `transform`'s output. Call `transform`\n * for the text (analyze.md §4, §5).\n */\nexport function analyze(input: string, options: Options): Change[] {\n return runAnalyze(input, options);\n}\n\nexport { SKIPPED_ELEMENTS } from \"./modes/html.js\";\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type {\n Dialect,\n Edit,\n LocaleData,\n LocaleSource,\n Mode,\n NarrowNbsp,\n Options,\n ProtectRange,\n QuotePair,\n Rule,\n RuleContext,\n RuleId,\n} from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,YAAY,MAA8B;AACjD,MAAI,SAAS,UAAa,SAAS,OAAQ,QAAO;AAClD,MAAI,SAAS,UAAU,SAAS,cAAc,SAAS,OAAQ,QAAO;AACtE,QAAM,IAAI;AAAA,IACR;AAAA,IACA,iBAAiB,OAAO,IAAI,CAAC;AAAA,EAC/B;AACF;AASO,SAAS,YAAY,OAAe,SAA0B;AAInE,QAAM,QAA0B,WAAW,CAAC;AAC5C,QAAM,OAAO,YAAY,MAAM,IAAI;AACnC,MAAI,SAAS,OAAQ,QAAO,gBAAgB,OAAO,KAAK;AACxD,MAAI,SAAS,OAAQ,QAAO,gBAAgB,OAAO,KAAK;AACxD,MAAI,SAAS,OAAQ,QAAO,gBAAgB,OAAO,KAAK;AACxD,SAAO,oBAAoB,OAAO,KAAK;AACzC;AAOO,SAAS,WAAW,OAAe,SAA4B;AACpE,QAAM,QAA0B,WAAW,CAAC;AAC5C,QAAM,OAAO,YAAY,MAAM,IAAI;AACnC,MAAI,SAAS,OAAQ,QAAO,oBAAoB,OAAO,KAAK;AAC5D,MAAI,SAAS,OAAQ,QAAO,oBAAoB,OAAO,KAAK;AAC5D,MAAI,SAAS,OAAQ,QAAO,oBAAoB,OAAO,KAAK;AAC5D,SAAO,wBAAwB,OAAO,KAAK;AAC7C;;;AC9CO,SAAS,UAAU,OAAe,SAA0B;AACjE,SAAO,YAAY,OAAO,OAAO;AACnC;AAYO,SAAS,QAAQ,OAAe,SAA4B;AACjE,SAAO,WAAW,OAAO,OAAO;AAClC;","names":[]}
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 _chunk6BEQTKTOcjs = require('./chunk-6BEQTKTO.cjs');
5
- require('./chunk-DGIQD3CL.cjs');
6
- require('./chunk-5NTTJKWN.cjs');
4
+ var _chunkN5VKLPITcjs = require('./chunk-N5VKLPIT.cjs');
5
+ require('./chunk-4GW2ZMIG.cjs');
6
+ require('./chunk-4FDTU4LV.cjs');
7
7
 
8
8
 
9
- var _chunkTO4ONFOScjs = require('./chunk-TO4ONFOS.cjs');
9
+ var _chunkBFRFZXOIcjs = require('./chunk-BFRFZXOI.cjs');
10
10
 
11
11
 
12
- var _chunkRM6623UNcjs = require('./chunk-RM6623UN.cjs');
12
+ var _chunkTWPD6PZYcjs = require('./chunk-TWPD6PZY.cjs');
13
13
 
14
14
  // src/index.markdown.ts
15
15
  function transform(input, options) {
16
16
  const given = _nullishCoalesce(options, () => ( {}));
17
- _chunkTO4ONFOScjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
18
- return _chunk6BEQTKTOcjs.runMarkdownPipeline.call(void 0, input, given);
17
+ _chunkBFRFZXOIcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
18
+ return _chunkN5VKLPITcjs.runMarkdownPipeline.call(void 0, input, given);
19
19
  }
20
20
  function analyze(input, options) {
21
21
  const given = _nullishCoalesce(options, () => ( {}));
22
- _chunkTO4ONFOScjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
23
- return _chunk6BEQTKTOcjs.analyzeMarkdownPipeline.call(void 0, input, given);
22
+ _chunkBFRFZXOIcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
23
+ return _chunkN5VKLPITcjs.analyzeMarkdownPipeline.call(void 0, input, given);
24
24
  }
25
25
 
26
26
 
27
27
 
28
28
 
29
- exports.PolytypoError = _chunkRM6623UNcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
29
+ exports.PolytypoError = _chunkTWPD6PZYcjs.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-46HVHDLD.js";
5
- import "./chunk-2DFXIIFM.js";
6
- import "./chunk-SMI5FQDC.js";
4
+ } from "./chunk-CWHCIX7Q.js";
5
+ import "./chunk-LHDMQYVE.js";
6
+ import "./chunk-2GDHU7YJ.js";
7
7
  import {
8
8
  assertFixedMode
9
- } from "./chunk-IAD2Z4LK.js";
9
+ } from "./chunk-DNFGA3PK.js";
10
10
  import {
11
11
  PolytypoError
12
- } from "./chunk-OW7RDXON.js";
12
+ } from "./chunk-HY3GXZAZ.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 _chunkCRSRFLXYcjs = require('./chunk-CRSRFLXY.cjs');
4
+ var _chunkQOW2MY3Icjs = require('./chunk-QOW2MY3I.cjs');
5
5
 
6
6
 
7
- var _chunkTO4ONFOScjs = require('./chunk-TO4ONFOS.cjs');
7
+ var _chunkBFRFZXOIcjs = require('./chunk-BFRFZXOI.cjs');
8
8
 
9
9
 
10
- var _chunkRM6623UNcjs = require('./chunk-RM6623UN.cjs');
10
+ var _chunkTWPD6PZYcjs = require('./chunk-TWPD6PZY.cjs');
11
11
 
12
12
  // src/index.text.ts
13
13
  function transform(input, options) {
14
14
  const given = _nullishCoalesce(options, () => ( {}));
15
- _chunkTO4ONFOScjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
16
- return _chunkCRSRFLXYcjs.runTextPipeline.call(void 0, input, given);
15
+ _chunkBFRFZXOIcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
16
+ return _chunkQOW2MY3Icjs.runTextPipeline.call(void 0, input, given);
17
17
  }
18
18
  function analyze(input, options) {
19
19
  const given = _nullishCoalesce(options, () => ( {}));
20
- _chunkTO4ONFOScjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
21
- return _chunkCRSRFLXYcjs.analyzeTextPipeline.call(void 0, input, given);
20
+ _chunkBFRFZXOIcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
21
+ return _chunkQOW2MY3Icjs.analyzeTextPipeline.call(void 0, input, given);
22
22
  }
23
23
 
24
24
 
25
25
 
26
26
 
27
- exports.PolytypoError = _chunkRM6623UNcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
27
+ exports.PolytypoError = _chunkTWPD6PZYcjs.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-SJTHHQVJ.js";
4
+ } from "./chunk-YATDFC7V.js";
5
5
  import {
6
6
  assertFixedMode
7
- } from "./chunk-IAD2Z4LK.js";
7
+ } from "./chunk-DNFGA3PK.js";
8
8
  import {
9
9
  PolytypoError
10
- } from "./chunk-OW7RDXON.js";
10
+ } from "./chunk-HY3GXZAZ.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 _chunkF6U75LDWcjs = require('./chunk-F6U75LDW.cjs');
5
- require('./chunk-5NTTJKWN.cjs');
4
+ var _chunkJG33G4ZRcjs = require('./chunk-JG33G4ZR.cjs');
5
+ require('./chunk-4FDTU4LV.cjs');
6
6
 
7
7
 
8
- var _chunkTO4ONFOScjs = require('./chunk-TO4ONFOS.cjs');
8
+ var _chunkBFRFZXOIcjs = require('./chunk-BFRFZXOI.cjs');
9
9
 
10
10
 
11
- var _chunkRM6623UNcjs = require('./chunk-RM6623UN.cjs');
11
+ var _chunkTWPD6PZYcjs = require('./chunk-TWPD6PZY.cjs');
12
12
 
13
13
  // src/index.yaml.ts
14
14
  function transform(input, options) {
15
15
  const given = _nullishCoalesce(options, () => ( {}));
16
- _chunkTO4ONFOScjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
17
- return _chunkF6U75LDWcjs.runYamlPipeline.call(void 0, input, given);
16
+ _chunkBFRFZXOIcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
17
+ return _chunkJG33G4ZRcjs.runYamlPipeline.call(void 0, input, given);
18
18
  }
19
19
  function analyze(input, options) {
20
20
  const given = _nullishCoalesce(options, () => ( {}));
21
- _chunkTO4ONFOScjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
22
- return _chunkF6U75LDWcjs.analyzeYamlPipeline.call(void 0, input, given);
21
+ _chunkBFRFZXOIcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
22
+ return _chunkJG33G4ZRcjs.analyzeYamlPipeline.call(void 0, input, given);
23
23
  }
24
24
 
25
25
 
26
26
 
27
27
 
28
- exports.PolytypoError = _chunkRM6623UNcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
28
+ exports.PolytypoError = _chunkTWPD6PZYcjs.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-Q23NSX5T.js";
5
- import "./chunk-SMI5FQDC.js";
4
+ } from "./chunk-2EEO3SUH.js";
5
+ import "./chunk-2GDHU7YJ.js";
6
6
  import {
7
7
  assertFixedMode
8
- } from "./chunk-IAD2Z4LK.js";
8
+ } from "./chunk-DNFGA3PK.js";
9
9
  import {
10
10
  PolytypoError
11
- } from "./chunk-OW7RDXON.js";
11
+ } from "./chunk-HY3GXZAZ.js";
12
12
 
13
13
  // src/index.yaml.ts
14
14
  function transform(input, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polytypo",
3
- "version": "1.29.0",
3
+ "version": "1.31.0",
4
4
  "description": "Normalize typography across languages: locale-correct quotes, dashes, ellipses and no-break spaces.",
5
5
  "keywords": [
6
6
  "typography",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/modes/html.ts","../src/modes/parse-error.ts"],"sourcesContent":["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 `&nbsp;` survives as\n * `&nbsp;` 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\n/**\n * modes.md 3.6 (spec 1.23.0): a text node of only U+0009, U+000A, U+000C, U+000D and U+0020 that\n * holds a line break is not a span, so the gap around it carries the raw line break and 3.2\n * picks the line marker. Pretty-printed markup then reads as `text` mode reads the same lines.\n */\nfunction isLineBreakWhitespace(source: string, start: number, end: number): boolean {\n let hasLineBreak = false;\n for (let i = start; i < end; i += 1) {\n const c = source.charCodeAt(i);\n if (c === 0x0a || c === 0x0c || c === 0x0d) hasLineBreak = true;\n else if (c !== 0x09 && c !== 0x20) return false;\n }\n return hasLineBreak;\n}\n\nconst LESS_THAN = 0x3c;\nconst SOLIDUS = 0x2f;\nconst GREATER_THAN = 0x3e;\nconst EQUALS = 0x3d;\n\nfunction isAsciiAlpha(unit: number): boolean {\n return (unit >= 0x41 && unit <= 0x5a) || (unit >= 0x61 && unit <= 0x7a);\n}\n\nfunction isTagSpace(unit: number): boolean {\n return unit === 0x09 || unit === 0x0a || unit === 0x0c || unit === 0x0d || unit === 0x20;\n}\n\n/**\n * The offset just past the tag that starts at `at`, or -1 when no tag starts there. Follows the\n * HTML tokenizer: `<` plus a letter, `</` plus a letter, or `</>`. A quote opens a value only in\n * the before-attribute-value state, reached by an `=` that follows an attribute name; an `=` that\n * begins a name, or sits inside an unquoted value, is data.\n */\nfunction tagEnd(source: string, at: number, limit: number): number {\n if (source.charCodeAt(at) !== LESS_THAN) return -1;\n let i = at + 1;\n if (i >= limit) return -1;\n if (source.charCodeAt(i) === SOLIDUS) {\n i += 1;\n if (i >= limit) return -1;\n if (source.charCodeAt(i) === GREATER_THAN) return i + 1;\n }\n if (!isAsciiAlpha(source.charCodeAt(i))) return -1;\n // tag name\n while (i < limit) {\n const c = source.charCodeAt(i);\n if (isTagSpace(c) || c === SOLIDUS || c === GREATER_THAN) break;\n i += 1;\n }\n while (i < limit) {\n // before attribute name\n let c = source.charCodeAt(i);\n if (isTagSpace(c) || c === SOLIDUS) {\n i += 1;\n continue;\n }\n if (c === GREATER_THAN) return i + 1;\n // attribute name: an `=` first in the name is part of it\n i += 1;\n while (i < limit) {\n c = source.charCodeAt(i);\n if (isTagSpace(c) || c === SOLIDUS || c === GREATER_THAN || c === EQUALS) break;\n i += 1;\n }\n // after attribute name\n while (i < limit && isTagSpace(source.charCodeAt(i))) i += 1;\n if (i >= limit) return -1;\n c = source.charCodeAt(i);\n if (c === GREATER_THAN) return i + 1;\n if (c !== EQUALS) continue;\n // before attribute value\n i += 1;\n while (i < limit && isTagSpace(source.charCodeAt(i))) i += 1;\n if (i >= limit) return -1;\n c = source.charCodeAt(i);\n if (c === GREATER_THAN) return i + 1;\n if (c === 0x22 || c === 0x27) {\n const close = source.indexOf(c === 0x22 ? '\"' : \"'\", i + 1);\n if (close === -1 || close >= limit) return -1;\n i = close + 1;\n continue;\n }\n while (i < limit) {\n c = source.charCodeAt(i);\n if (isTagSpace(c) || c === GREATER_THAN) break;\n i += 1;\n }\n }\n return -1;\n}\n\n/**\n * modes.md 3.6 (spec 1.23.1): a tag the parser ignores is still a tag in the source, and parse5\n * merges the text on either side of it into one node. Splitting the run at every tag-shaped token\n * keeps the tag outside every span and puts it in the gap, where 3.2 chooses the marker.\n */\nfunction textPieces(source: string, start: number, end: number): Array<[number, number]> {\n const pieces: Array<[number, number]> = [];\n let cursor = start;\n let i = start;\n while (i < end) {\n if (source.charCodeAt(i) === LESS_THAN) {\n const stop = tagEnd(source, i, end);\n if (stop > 0) {\n if (i > cursor) pieces.push([cursor, i]);\n cursor = stop;\n i = stop;\n continue;\n }\n }\n i += 1;\n }\n if (end > cursor) pieces.push([cursor, end]);\n return pieces;\n}\n\n// Their text is character data, not markup: `<` begins no tag inside them (HTML tokenizer RCDATA,\n// RAWTEXT and PLAINTEXT states), so textPieces must not look for one.\nconst TEXT_ONLY_PARENTS = new Set([\n \"title\",\n \"xmp\",\n \"iframe\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"plaintext\",\n]);\n\nfunction collect(node: Node, source: string, spans: Span[], isTextOnly = false): void {\n if (node.nodeName === \"#text\") {\n const location = node.sourceCodeLocation;\n if (location === undefined || location === null) return;\n const pieces = isTextOnly\n ? ([[location.startOffset, location.endOffset]] as Array<[number, number]>)\n : textPieces(source, location.startOffset, location.endOffset);\n for (const [from, to] of pieces) {\n if (isLineBreakWhitespace(source, from, to)) continue;\n for (const span of splitCharacterReferences(source, from, to)) 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 const textOnly = \"tagName\" in node && TEXT_ONLY_PARENTS.has(node.tagName);\n for (const child of node.childNodes) collect(child, source, spans, textOnly);\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"],"mappings":";;;;;AAAA,SAAS,OAAO,qBAAqB;;;ACOrC,SAAS,SAAS,OAAwB;AACxC,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO,OAAO,KAAK;AACpE,QAAM,aAAa;AACnB,QAAM,SACJ,OAAO,WAAW,WAAW,WAAW,WAAW,SAAU,MAAgB;AAC/E,QAAM,QAAQ,WAAW;AACzB,MACE,UAAU,QACV,UAAU,UACV,OAAO,MAAM,SAAS,YACtB,OAAO,MAAM,WAAW,UACxB;AACA,WAAO,GAAG,MAAM,UAAU,MAAM,IAAI,YAAY,MAAM,MAAM;AAAA,EAC9D;AACA,SAAO;AACT;AAcO,SAAS,iBAAoB,MAAc,KAAiB;AACjE,MAAI;AACF,WAAO,IAAI;AAAA,EACb,SAAS,OAAO;AACd,QAAI,iBAAiB,cAAe,OAAM;AAC1C,UAAM,IAAI;AAAA,MACR;AAAA,MACA,2BAA2B,IAAI,KAAK,SAAS,KAAK,CAAC;AAAA,IACrD;AAAA,EACF;AACF;;;AD/BA,IAAM,mBAAwC,oBAAI,IAAI;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,SAAS,iBAAiB,SAA0B;AACzD,SAAO,iBAAiB,IAAI,OAAO;AACrC;AAEA,IAAM,YAAY;AAClB,IAAM,YAAY;AAClB,IAAM,OAAO;AACb,IAAM,UAAU;AAChB,IAAM,UAAU;AAGhB,IAAM,qBAAqB;AAE3B,SAAS,aAAa,MAAuB;AAC3C,SAAO,QAAQ,MAAQ,QAAQ;AACjC;AAEA,SAAS,gBAAgB,MAAuB;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C7E;AAQO,SAAS,UAAU,QAAwB;AAChD,QAAM,WAAW,iBAAiB,QAAQ,MAAM,MAAM,QAAQ,EAAE,wBAAwB,KAAK,CAAC,CAAC;AAC/F,QAAM,QAAgB,CAAC;AACvB,UAAQ,UAAU,QAAQ,KAAK;AAC/B,SAAO;AACT;AAGO,SAAS,kBAAkB,QAAgB,QAAwB;AACxE,QAAM,WAAW;AAAA,IAAiB;AAAA,IAAQ,MACxC,cAAc,QAAQ,EAAE,wBAAwB,KAAK,CAAC;AAAA,EACxD;AACA,QAAM,QAAgB,CAAC;AACvB,UAAQ,UAAU,QAAQ,KAAK;AAC/B,SAAO,WAAW,IACd,QACA,MAAM,IAAI,CAAC,UAAU,EAAE,OAAO,KAAK,QAAQ,QAAQ,KAAK,KAAK,MAAM,OAAO,EAAE;AAClF;","names":[]}
@@ -1,34 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkDGIQD3CLcjs = require('./chunk-DGIQD3CL.cjs');
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
- var _chunkRM6623UNcjs = require('./chunk-RM6623UN.cjs');
12
-
13
- // src/engine/html-pipeline.ts
14
- function runHtmlPipeline(input, options) {
15
- const narrowTarget = _chunkRM6623UNcjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
16
- const planned = _chunkRM6623UNcjs.planRules.call(void 0, options.rules);
17
- const locale = _chunkRM6623UNcjs.getLocaleData.call(void 0, options.locale);
18
- _chunkRM6623UNcjs.assertNoProtect.call(void 0, options.protect, "html");
19
- const spans = _chunkDGIQD3CLcjs.htmlSpans.call(void 0, input);
20
- return _chunkRM6623UNcjs.runOverSpans.call(void 0, input, spans, planned, locale, "html", narrowTarget);
21
- }
22
- function analyzeHtmlPipeline(input, options) {
23
- const narrowTarget = _chunkRM6623UNcjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
24
- const planned = _chunkRM6623UNcjs.planRules.call(void 0, options.rules);
25
- const locale = _chunkRM6623UNcjs.getLocaleData.call(void 0, options.locale);
26
- _chunkRM6623UNcjs.assertNoProtect.call(void 0, options.protect, "html");
27
- return _chunkRM6623UNcjs.analyzeOverSpans.call(void 0, input, _chunkDGIQD3CLcjs.htmlSpans.call(void 0, input), planned, locale, "html", narrowTarget);
28
- }
29
-
30
-
31
-
32
-
33
- exports.runHtmlPipeline = runHtmlPipeline; exports.analyzeHtmlPipeline = analyzeHtmlPipeline;
34
- //# sourceMappingURL=chunk-5X4EL2FZ.cjs.map