polytypo 1.2.0 → 1.3.1
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/README.md +48 -0
- package/dist/{chunk-KAO74OJ6.js → chunk-4GYU4TXA.js} +2 -2
- package/dist/{chunk-6NTDU63P.js → chunk-5NCJ3Y65.js} +35 -11
- package/dist/chunk-5NCJ3Y65.js.map +1 -0
- package/dist/chunk-5U3DRTV7.js +205 -0
- package/dist/chunk-5U3DRTV7.js.map +1 -0
- package/dist/chunk-5VNPHCL2.cjs +264 -0
- package/dist/chunk-5VNPHCL2.cjs.map +1 -0
- package/dist/{chunk-POGDWVG5.cjs → chunk-AR6FDQAX.cjs} +40 -16
- package/dist/chunk-AR6FDQAX.cjs.map +1 -0
- package/dist/chunk-B7WXSXRG.js +31 -0
- package/dist/chunk-B7WXSXRG.js.map +1 -0
- package/dist/{chunk-VARU43JT.js → chunk-DXWMSR26.js} +4 -154
- package/dist/chunk-DXWMSR26.js.map +1 -0
- package/dist/chunk-ECYUONLP.cjs +205 -0
- package/dist/chunk-ECYUONLP.cjs.map +1 -0
- package/dist/chunk-FK3F3YZT.cjs +33 -0
- package/dist/chunk-FK3F3YZT.cjs.map +1 -0
- package/dist/chunk-QNSBCZU5.cjs +31 -0
- package/dist/chunk-QNSBCZU5.cjs.map +1 -0
- package/dist/chunk-THTCAO3O.cjs +147 -0
- package/dist/chunk-THTCAO3O.cjs.map +1 -0
- package/dist/chunk-UBEV2AC3.js +264 -0
- package/dist/chunk-UBEV2AC3.js.map +1 -0
- package/dist/chunk-V4EOJ44S.cjs +5778 -0
- package/dist/chunk-V4EOJ44S.cjs.map +1 -0
- package/dist/chunk-VC5XLP6O.js +33 -0
- package/dist/chunk-VC5XLP6O.js.map +1 -0
- package/dist/chunk-VKJVMMCI.js +5778 -0
- package/dist/chunk-VKJVMMCI.js.map +1 -0
- package/dist/{chunk-YYHKX5HE.cjs → chunk-W2T7B2SH.cjs} +3 -3
- package/dist/{chunk-YYHKX5HE.cjs.map → chunk-W2T7B2SH.cjs.map} +1 -1
- package/dist/{errors-joZChNws.d.ts → errors-CGFOVO3h.d.cts} +34 -4
- package/dist/{errors-joZChNws.d.cts → errors-CGFOVO3h.d.ts} +34 -4
- package/dist/html.cjs +15 -7
- package/dist/html.cjs.map +1 -1
- package/dist/html.d.cts +9 -3
- package/dist/html.d.ts +9 -3
- package/dist/html.js +12 -4
- package/dist/html.js.map +1 -1
- package/dist/index.cjs +33 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +28 -7
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +15 -7
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.d.cts +9 -3
- package/dist/markdown.d.ts +9 -3
- package/dist/markdown.js +12 -4
- package/dist/markdown.js.map +1 -1
- package/dist/text.cjs +13 -6
- package/dist/text.cjs.map +1 -1
- package/dist/text.d.cts +8 -3
- package/dist/text.d.ts +8 -3
- package/dist/text.js +10 -3
- package/dist/text.js.map +1 -1
- package/dist/yaml.cjs +29 -0
- package/dist/yaml.cjs.map +1 -0
- package/dist/yaml.d.cts +27 -0
- package/dist/yaml.d.ts +27 -0
- package/dist/yaml.js +29 -0
- package/dist/yaml.js.map +1 -0
- package/package.json +12 -2
- package/dist/chunk-44A6YP7S.js +0 -21
- package/dist/chunk-44A6YP7S.js.map +0 -1
- package/dist/chunk-5VBDCDS6.cjs +0 -19
- package/dist/chunk-5VBDCDS6.cjs.map +0 -1
- package/dist/chunk-6NTDU63P.js.map +0 -1
- package/dist/chunk-B4O4R6HI.cjs +0 -5633
- package/dist/chunk-B4O4R6HI.cjs.map +0 -1
- package/dist/chunk-HGUA2NVX.cjs +0 -21
- package/dist/chunk-HGUA2NVX.cjs.map +0 -1
- package/dist/chunk-LS57O4KJ.cjs +0 -297
- package/dist/chunk-LS57O4KJ.cjs.map +0 -1
- package/dist/chunk-OHF7OFWY.js +0 -5633
- package/dist/chunk-OHF7OFWY.js.map +0 -1
- package/dist/chunk-POGDWVG5.cjs.map +0 -1
- package/dist/chunk-RC3UKUYZ.js +0 -19
- package/dist/chunk-RC3UKUYZ.js.map +0 -1
- package/dist/chunk-VARU43JT.js.map +0 -1
- /package/dist/{chunk-KAO74OJ6.js.map → chunk-4GYU4TXA.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-POGDWVG5.cjs","../src/modes/markdown.ts","../src/engine/markdown-pipeline.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACZA,sCAA+C;AAC/C,gFAA4B;AAC5B,gEAAoB;AACpB,oEAAsB;AAgBtB,IAAM,oBAAA,kBAA2C,IAAI,GAAA,CAAI;AAAA;AAAA,EAEvD,YAAA;AAAA,EACA,cAAA;AAAA;AAAA,EAEA,UAAA;AAAA;AAAA,EAEA,UAAA;AAAA,EACA,iBAAA;AAAA;AAAA;AAAA,EAGA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA;AAAA;AAAA;AAAA,EAIA,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA,UAAA;AAAA;AAAA;AAAA;AAAA,EAIA;AACF,CAAC,CAAA;AAGD,IAAM,oBAAA,kBAA2C,IAAI,GAAA,CAAI;AAAA,EACvD,UAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,UAAA,EAAY,EAAA;AAClB,IAAM,aAAA,EAAe,EAAA;AACrB,IAAM,MAAA,EAAQ,EAAA;AACd,IAAM,YAAA,EAAc,EAAA;AACpB,IAAM,SAAA,EAAW,EAAA;AAEjB,SAAS,aAAA,CAAc,IAAA,EAAuB;AAC5C,EAAA,OAAQ,KAAA,GAAQ,GAAA,GAAQ,KAAA,GAAQ,IAAA,GAA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AA,CAAI,OAAO,CAAC,CAAA;AAAA,IACjE;AAAA,EACF;AAEA,EAAA,OAAO,KAAA;AACT;ADrDA;AACA;AEtIO,SAAS,mBAAA,CAAoB,KAAA,EAAe,OAAA,EAAmC;AACpF,EAAA,MAAM,QAAA,EAAU,yCAAA,OAAU,CAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,OAAA,EAAS,6CAAA,OAAc,CAAQ,MAAM,CAAA;AAC3C,EAAA,MAAM,QAAA,EAAU,cAAA,CAAe,OAAA,CAAQ,OAAO,CAAA;AAC9C,EAAA,MAAM,MAAA,EAAQ,aAAA,CAAc,KAAA,EAAO,OAAO,CAAA;AAC1C,EAAA,OAAO,4CAAA,KAAa,EAAO,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,UAAU,CAAA;AAC/D;AFwIA;AACA;AACE;AACF,kDAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/chunk-POGDWVG5.cjs","sourcesContent":[null,"import { parse, postprocess, preprocess } from \"micromark\";\nimport { frontmatter } from \"micromark-extension-frontmatter\";\nimport { gfm } from \"micromark-extension-gfm\";\nimport { mdxjs } from \"micromark-extension-mdxjs\";\nimport type { Event, Extension } from \"micromark-util-types\";\nimport { PolytypoError } from \"../errors.js\";\nimport type { Dialect } from \"../types.js\";\nimport { htmlFragmentSpans, isSkippedElement } from \"./html.js\";\nimport { wrapParserErrors } from \"./parse-error.js\";\nimport type { Span } from \"./spans.js\";\n\n/**\n * spec/rules/modes.md 3.7. Each entry is skipped **whole**, including anything that looks\n * processable inside it. The complement is not enumerated: a span is emitted only for a\n * micromark `data` token, which is the tokenizer's own name for \"literal content\", so list\n * markers, emphasis delimiters, heading sequences, table padding, line endings, hard-break\n * spaces, character escapes and character references are outside every span by construction\n * rather than by a second list that could drift from the first.\n */\nconst SKIPPED_TOKEN_TYPES: ReadonlySet<string> = new Set([\n // fenced code blocks (including the info string and the fences) and indented code blocks\n \"codeFenced\",\n \"codeIndented\",\n // inline code spans, including the backticks\n \"codeText\",\n // autolinks `<https://…>`, and GFM's bare-URL form\n \"autolink\",\n \"literalAutolink\",\n // link and image destinations and titles; the definition line of a reference link. The link\n // *text* is a `labelText`, which is not skipped.\n \"resource\",\n \"reference\",\n \"definition\",\n // MDX: expression containers in full, and every JSX attribute — the whole tag is skipped, so\n // attributes never surface. JSX element *children* sit outside the tag tokens and are\n // processable.\n \"mdxFlowExpression\",\n \"mdxTextExpression\",\n \"mdxjsEsm\",\n // Not in modes.md 3.7, and it has to be: without it the second `---` of a YAML block reads as\n // a setext underline, `title: Une note` becomes a paragraph, and `fr` puts a narrow no-break\n // space in front of the colon of a machine-read metadata field. Reported as a spec gap.\n \"frontmatter\",\n]);\n\n/** Token types whose enter/exit also maintains the skipped-element stack. */\nconst RAW_TAG_TOKEN_TYPES: ReadonlySet<string> = new Set([\n \"htmlText\",\n \"mdxJsxTextTag\",\n \"mdxJsxFlowTag\",\n]);\n\nconst LESS_THAN = 0x3c;\nconst GREATER_THAN = 0x3e;\nconst SLASH = 0x2f;\nconst EXCLAMATION = 0x21;\nconst QUESTION = 0x3f;\n\nfunction isAsciiLetter(unit: number): boolean {\n return (unit >= 0x61 && unit <= 0x7a) || (unit >= 0x41 && unit <= 0x5a);\n}\n\nfunction isTagNameUnit(unit: number): boolean {\n // Deliberately permissive: anything that is not a delimiter belongs to the name. Custom\n // elements (`my-callout`) and member expressions (`Foo.Bar`) must come out whole so that they\n // fail the skip-list membership test rather than being truncated into something that passes.\n return (\n unit !== GREATER_THAN &&\n unit !== SLASH &&\n unit !== 0x20 &&\n unit !== 0x09 &&\n unit !== 0x0a &&\n unit !== 0x0d\n );\n}\n\n/** ASCII-only, because HTML tag names are ASCII case-insensitive and `toLowerCase()` is not. */\nfunction asciiLower(value: string): string {\n let out = \"\";\n for (let i = 0; i < value.length; i += 1) {\n const unit = value.charCodeAt(i);\n out += unit >= 0x41 && unit <= 0x5a ? String.fromCharCode(unit + 0x20) : value[i];\n }\n return out;\n}\n\ninterface RawTag {\n readonly name: string;\n readonly closing: boolean;\n readonly selfClosing: boolean;\n}\n\nfunction readTag(tag: string): RawTag | null {\n if (tag.charCodeAt(0) !== LESS_THAN) return null;\n let i = 1;\n const closing = tag.charCodeAt(i) === SLASH;\n if (closing) i += 1;\n // Comments, declarations and processing instructions carry no element name.\n if (tag.charCodeAt(i) === EXCLAMATION || tag.charCodeAt(i) === QUESTION) return null;\n if (!isAsciiLetter(tag.charCodeAt(i))) return null;\n const nameAt = i;\n while (i < tag.length && isTagNameUnit(tag.charCodeAt(i))) i += 1;\n const selfClosing = tag.charCodeAt(tag.length - 2) === SLASH;\n return { name: tag.slice(nameAt, i), closing, selfClosing };\n}\n\n/**\n * modes.md 3.7: raw HTML is \"handed to the html skip list of 3.6\". Inline raw HTML reaches the\n * tokenizer as isolated tags with ordinary markdown content between them, so honouring the\n * subtree rule means tracking which skipped element is currently open. JSX names are compared\n * case-sensitively (`<Code>` is a component, `<code>` is an element); HTML names are not.\n */\nfunction updateElementStack(stack: string[], tag: string, caseSensitive: boolean): void {\n const parsed = readTag(tag);\n if (parsed === null) return;\n const name = caseSensitive ? parsed.name : asciiLower(parsed.name);\n if (parsed.closing) {\n if (stack[stack.length - 1] === name) stack.pop();\n return;\n }\n if (!parsed.selfClosing && isSkippedElement(name)) stack.push(name);\n}\n\nfunction tokenize(source: string, extensions: readonly Extension[]): Event[] {\n return postprocess(\n parse({ extensions: [...extensions] })\n .document()\n .write(preprocess()(source, null, true)),\n );\n}\n\n/**\n * modes.md 3.7.1. The dialect is the caller's, never detected: `\"commonmark\"` is CommonMark 0.31\n * plus GFM, `\"mdx\"` is the same minus indented code blocks and `<…>` autolinks, plus JSX and\n * `{…}` expression containers. Both enable frontmatter and GFM, which 3.7.2 makes normative —\n * §4's promise that table alignment rows survive is empty unless tables are recognised at all.\n */\nexport function resolveDialect(dialect: Dialect | undefined): Dialect {\n if (dialect === \"commonmark\" || dialect === \"mdx\") return dialect;\n if (dialect === undefined) {\n throw new PolytypoError(\n \"POLYTYPO_INVALID_DIALECT\",\n 'Mode \"markdown\" requires a dialect. Expected \"commonmark\" or \"mdx\"; there is no default.',\n );\n }\n throw new PolytypoError(\n \"POLYTYPO_INVALID_DIALECT\",\n `Unknown dialect \"${String(dialect)}\". Expected \"commonmark\" or \"mdx\".`,\n );\n}\n\nfunction extensionsFor(dialect: Dialect): Extension[] {\n return dialect === \"mdx\" ? [frontmatter(), gfm(), mdxjs()] : [frontmatter(), gfm()];\n}\n\nexport function markdownSpans(source: string, dialect: Dialect): Span[] {\n const events = wrapParserErrors(dialect, () => tokenize(source, extensionsFor(dialect)));\n const spans: Span[] = [];\n const elementStack: string[] = [];\n let skipDepth = 0;\n\n for (const [kind, token] of events) {\n const type = token.type;\n\n if (SKIPPED_TOKEN_TYPES.has(type)) {\n skipDepth += kind === \"enter\" ? 1 : -1;\n continue;\n }\n\n if (RAW_TAG_TOKEN_TYPES.has(type)) {\n if (kind === \"enter\") {\n updateElementStack(\n elementStack,\n source.slice(token.start.offset, token.end.offset),\n type !== \"htmlText\",\n );\n }\n skipDepth += kind === \"enter\" ? 1 : -1;\n continue;\n }\n\n // An HTML block is handed to the `html` extractor rather than skipped whole, so that the\n // prose inside `<div>…</div>` is typeset while the markup is not.\n if (type === \"htmlFlow\") {\n if (kind === \"enter\" && skipDepth === 0 && elementStack.length === 0) {\n for (const span of htmlFragmentSpans(\n source.slice(token.start.offset, token.end.offset),\n token.start.offset,\n )) {\n spans.push(span);\n }\n }\n skipDepth += kind === \"enter\" ? 1 : -1;\n continue;\n }\n\n if (kind === \"enter\" && type === \"data\" && skipDepth === 0 && elementStack.length === 0) {\n spans.push({ start: token.start.offset, end: token.end.offset });\n }\n }\n\n return spans;\n}\n","import { markdownSpans, resolveDialect } from \"../modes/markdown.js\";\nimport type { Options } from \"../types.js\";\nimport { getLocaleData } from \"./locale.js\";\nimport { planRules } from \"./rule-runner.js\";\nimport { runOverSpans } from \"./span-runner.js\";\n\n/**\n * `markdown` mode only. Imports the Micromark/MDX stack and `parse5` (via `../modes/markdown.js`\n * importing `../modes/html.js` for normative embedded-HTML handling, modes.md 3.7) — both are\n * legitimately reachable from `polytypo/markdown` (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1).\n *\n * Validation order — `planRules`, then `getLocaleData`, then `resolveDialect`/parsing — mirrors\n * the pre-Stage-5 aggregate `runPipeline` exactly: an unknown-rule error wins over an\n * unknown-locale error, which wins over a missing/invalid dialect, which wins over a parse\n * failure. All four are public, tested behaviour this refactor was not authorised to change.\n */\nexport function runMarkdownPipeline(input: string, options: Partial<Options>): string {\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n const dialect = resolveDialect(options.dialect);\n const spans = markdownSpans(input, dialect);\n return runOverSpans(input, spans, planned, locale, \"markdown\");\n}\n"]}
|
package/dist/chunk-RC3UKUYZ.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
fromCodePoints,
|
|
3
|
-
getLocaleData,
|
|
4
|
-
planRules,
|
|
5
|
-
runRules,
|
|
6
|
-
toCodePoints
|
|
7
|
-
} from "./chunk-OHF7OFWY.js";
|
|
8
|
-
|
|
9
|
-
// src/engine/text-pipeline.ts
|
|
10
|
-
function runTextPipeline(input, options) {
|
|
11
|
-
const planned = planRules(options.rules);
|
|
12
|
-
const locale = getLocaleData(options.locale);
|
|
13
|
-
return fromCodePoints(runRules(toCodePoints(input), planned, locale, "text"));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
runTextPipeline
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=chunk-RC3UKUYZ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/engine/text-pipeline.ts"],"sourcesContent":["import type { Options } from \"../types.js\";\nimport { fromCodePoints, toCodePoints } from \"./codepoints.js\";\nimport { getLocaleData } from \"./locale.js\";\nimport { planRules, runRules } from \"./rule-runner.js\";\n\n/**\n * `text` mode only. Deliberately imports nothing from `../modes/html.js` or\n * `../modes/markdown.js` (or their parser dependencies) — this is what makes `polytypo/text`'s\n * module graph exclude `parse5` and the Micromark stack (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md\n * 5.1).\n *\n * Validation order — `planRules` before `getLocaleData` — mirrors the pre-Stage-5 aggregate\n * `runPipeline` exactly (an unknown-rule error must win over an unknown-locale error when both\n * are present, since that is public, tested behaviour, not an implementation detail this\n * refactor was authorised to change).\n */\nexport function runTextPipeline(input: string, options: Partial<Options>): string {\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n return fromCodePoints(runRules(toCodePoints(input), planned, locale, \"text\"));\n}\n"],"mappings":";;;;;;;;;AAgBO,SAAS,gBAAgB,OAAe,SAAmC;AAChF,QAAM,UAAU,UAAU,QAAQ,KAAK;AACvC,QAAM,SAAS,cAAc,QAAQ,MAAM;AAC3C,SAAO,eAAe,SAAS,aAAa,KAAK,GAAG,SAAS,QAAQ,MAAM,CAAC;AAC9E;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/modes/html.ts","../src/modes/parse-error.ts","../src/modes/spans.ts","../src/engine/span-runner.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 ` ` 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","import { toCodePoints } from \"../engine/codepoints.js\";\nimport { isMarker, LINE_MARKER, MARKER } from \"../engine/sentinels.js\";\nimport { PolytypoError } from \"../errors.js\";\nimport type { Edit } from \"../types.js\";\n\n/**\n * The boundary markers are defined in the engine (src/engine/sentinels.ts), which is where all\n * three non-code-point sentinels live and where their disjointness is maintained. They are\n * re-exported here because the mode layer is what writes them into the array.\n *\n * Which marker separates two spans is decided by the **raw source bytes of the gap between\n * them**, so it is decidable without asking the parser anything and is identical in five\n * runtimes: a gap containing a line terminator gives `LINE_MARKER`, anything else `MARKER`.\n */\nexport { LINE_MARKER, MARKER, isMarker } from \"../engine/sentinels.js\";\n\n/** `BREAK` as the rules define it (`spaces.md` 3.1), tested against the gap's raw source. */\nconst LINE_TERMINATORS: ReadonlySet<number> = new Set([\n 0x0a, 0x0d, 0x0b, 0x0c, 0x85, 0x2028, 0x2029,\n]);\n\nfunction gapIsLineBoundary(source: string, from: number, to: number): boolean {\n for (let i = from; i < to; i += 1) {\n if (LINE_TERMINATORS.has(source.charCodeAt(i))) return true;\n }\n return false;\n}\n\n/**\n * A processable span, identified by its offsets in the **original source**. Offsets are UTF-16\n * indices into the JS source string, which is what every JS parser reports; they are an\n * implementation detail of this runtime and never reach the rules, which index code points.\n */\nexport interface Span {\n readonly start: number;\n readonly end: number;\n}\n\n/** A span's extent in the concatenated code-point array: `s₀` and `s₁` of modes.md 3.4. */\nexport interface SpanRange {\n readonly first: number;\n readonly last: number;\n}\n\n/**\n * Sort, drop empties, and coalesce spans separated by nothing in the source (modes.md 7.5:\n * a parser that reports one text run as two adjacent nodes must not manufacture a boundary).\n * Overlapping spans are an extractor bug and are rejected rather than silently merged.\n */\nexport function normalizeSpans(spans: readonly Span[]): Span[] {\n const sorted = spans.filter((s) => s.end > s.start).sort((a, b) => a.start - b.start);\n const out: Span[] = [];\n for (const span of sorted) {\n const last = out[out.length - 1];\n if (last === undefined) {\n out.push(span);\n continue;\n }\n if (span.start < last.end) {\n throw new PolytypoError(\n \"POLYTYPO_RULE_CONTRACT\",\n `mode extractor produced overlapping spans (${last.start}, ${last.end}) and (${span.start}, ${span.end})`,\n );\n }\n if (span.start === last.end) {\n out[out.length - 1] = { start: last.start, end: span.end };\n continue;\n }\n out.push(span);\n }\n return out;\n}\n\n/** `S₁ ⌢ [marker] ⌢ S₂ ⌢ … ⌢ Sₘ` (modes.md 3.5 step 2). */\nexport function concatenateSpans(source: string, spans: readonly Span[]): number[] {\n const cp: number[] = [];\n let previous: Span | undefined;\n for (const span of spans) {\n if (previous !== undefined) {\n cp.push(gapIsLineBoundary(source, previous.end, span.start) ? LINE_MARKER : MARKER);\n }\n for (const value of toCodePoints(source.slice(span.start, span.end))) cp.push(value);\n previous = span;\n }\n return cp;\n}\n\n/**\n * The span extents of the array as it stands. Recomputed after every rule, because applying\n * edits shifts every index after the first one — the markers themselves are guaranteed to\n * survive, since no edit may contain one.\n */\nexport function spanRangesOf(cp: readonly number[]): SpanRange[] {\n const ranges: SpanRange[] = [];\n let first = 0;\n for (let i = 0; i < cp.length; i += 1) {\n if (isMarker(cp[i] as number)) {\n ranges.push({ first, last: i - 1 });\n first = i + 1;\n }\n }\n ranges.push({ first, last: cp.length - 1 });\n return ranges;\n}\n\nfunction spanContaining(ranges: readonly SpanRange[], p: number): SpanRange | undefined {\n for (const range of ranges) {\n if (p >= range.first && p <= range.last + 1) return range;\n }\n return undefined;\n}\n\n/**\n * modes.md 3.4, two safety nets, both pure functions of `(p, q, r, s₀, s₁)` — so the verdict is\n * identical on every run, which is what makes redistribution deterministic (modes.md 5, point 3).\n *\n * 1. **No edit may contain a marker.** No rule can produce one; one that does is a bug, and the\n * edit is discarded rather than treated as a redistribution question.\n * 2. **The edge-growth rule.** An edit is discarded if it would place code points at an\n * extremity of its span that were not there before: with `d = q - p + 1` the replaced length\n * and `r` the replacement length, discard when `p = s₀ and r > d`, or `q = s₁ and r > d`.\n *\n * The length test is the whole rule and needs no knowledge of Markdown or HTML syntax. It\n * separates exactly the cases that matter: `\"` → `“` at an edge is 1 → 1 and applies; `--` →\n * `␣–␣` at an edge is 2 → 3 and is discarded, while the same edit interior to a span applies;\n * `(c)` → `©` is 3 → 1 and applies, because shrinking is always safe. An insertion has `d = 0`,\n * so it is discarded exactly when its position coincides with a span edge — the rule this one\n * generalises.\n *\n * **Deletion at an edge is not restricted here**, and must not be: `r > d` is false for a\n * deletion, so this filter never sees one. Deletion at an edge is governed by modes.md 3.3's\n * *Edge tests* clause instead — where a rule asks \"am I at the edge of the text I am allowed to\n * modify\" rather than \"what character is here\", the marker behaves as `NONE`. That clause is the\n * one place a rule may treat a span edge as the end of the text, it exists because `spaces` is\n * the only rule that deletes, and 3.3 states the division: **a rule that deletes must treat a\n * span edge as the end of the text; a rule that replaces or inserts must not, and is governed by\n * this filter.** The single test that claims the clause is `spaces.md` 3.2 step 4.\n */\nexport function filterBoundaryEdits(\n cp: readonly number[],\n edits: readonly Edit[],\n ranges: readonly SpanRange[],\n): Edit[] {\n const out: Edit[] = [];\n for (const edit of edits) {\n let containsMarker = false;\n for (let i = edit.start; i < edit.end; i += 1) {\n if (isMarker(cp[i] as number)) {\n containsMarker = true;\n break;\n }\n }\n if (containsMarker) continue;\n\n // `[start, end)` in the engine's half-open form is `cp[p … q]` with p = start, q = end - 1;\n // an insertion is `q = p - 1`, which falls out of the same expression.\n const p = edit.start;\n const q = edit.end - 1;\n const d = edit.end - edit.start;\n const r = edit.replacement.length;\n const span = spanContaining(ranges, p);\n if (span !== undefined && r > d && (p === span.first || q === span.last)) continue;\n\n out.push(edit);\n }\n return out;\n}\n\n/** Redistribute the transformed array back to one piece per span (modes.md 3.5 step 4). */\nexport function splitOnMarker(cp: readonly number[], expected: number): number[][] {\n const pieces: number[][] = [[]];\n for (const value of cp) {\n if (isMarker(value)) {\n pieces.push([]);\n continue;\n }\n (pieces[pieces.length - 1] as number[]).push(value);\n }\n if (pieces.length !== expected) {\n throw new PolytypoError(\n \"POLYTYPO_RULE_CONTRACT\",\n `boundary markers did not survive the pipeline: expected ${expected} spans, found ${pieces.length}`,\n );\n }\n return pieces;\n}\n","import {\n concatenateSpans,\n filterBoundaryEdits,\n normalizeSpans,\n spanRangesOf,\n splitOnMarker,\n type Span,\n} from \"../modes/spans.js\";\nimport { RULES } from \"../rules/registry.js\";\nimport type { LocaleData, Mode, RuleId } from \"../types.js\";\nimport { applyEdits } from \"./edits.js\";\nimport { fromCodePoints } from \"./codepoints.js\";\n\n/**\n * The same sequence as `runRules` (`./rule-runner.js`), with the two boundary filters of\n * modes.md 3.4 interposed. The span extents are recomputed after every rule, because applying\n * an edit shifts every index after it; the markers themselves always survive, since no edit may\n * contain one.\n */\nfunction runRulesOverSpans(\n cp: readonly number[],\n planned: readonly RuleId[],\n locale: LocaleData,\n mode: Mode,\n): readonly number[] {\n let current = cp;\n for (const id of planned) {\n const rule = RULES[id];\n if (rule === undefined) continue;\n const edits = rule.apply({ cp: current, locale, mode });\n current = applyEdits(current, filterBoundaryEdits(current, edits, spanRangesOf(current)), id);\n }\n return current;\n}\n\n/**\n * modes.md 3.5. The pipeline runs **once**, over the marker-separated concatenation of every\n * processable span — not per span, which would pair quotation marks in isolation, and not over a\n * naive concatenation, which would manufacture adjacencies the document does not have.\n *\n * The output is the input with a set of disjoint substring replacements applied and nothing else\n * (modes.md 4). A span whose content the rules did not change contributes no replacement, so a\n * document needing no changes comes back byte-identical; the parser located the spans and was\n * then discarded, and the document is never serialised.\n */\nexport function runOverSpans(\n source: string,\n spans: readonly Span[],\n planned: readonly RuleId[],\n locale: LocaleData,\n mode: Mode,\n): string {\n const normalized = normalizeSpans(spans);\n if (normalized.length === 0) return source;\n\n const transformed = runRulesOverSpans(\n concatenateSpans(source, normalized),\n planned,\n locale,\n mode,\n );\n const pieces = splitOnMarker(transformed, normalized.length);\n\n let out = \"\";\n let cursor = 0;\n for (let i = 0; i < normalized.length; i += 1) {\n const span = normalized[i] as Span;\n const replacement = fromCodePoints(pieces[i] as number[]);\n const original = source.slice(span.start, span.end);\n out += source.slice(cursor, span.start);\n out += replacement === original ? original : replacement;\n cursor = span.end;\n }\n return out + source.slice(cursor);\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,OAAO,qBAAqB;;;ACOrC,SAAS,SAAS,OAAwB;AACxC,MAAI,OAAO,UAAU,YAAY,U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