polytypo 1.7.0 → 1.8.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.
- package/dist/{chunk-GUTUSN4K.js → chunk-4RAZ2EDS.js} +4 -4
- package/dist/{chunk-74I62TZ2.js → chunk-6UQAKZ7L.js} +4 -4
- package/dist/{chunk-JVBK3LG3.js → chunk-EH542ZE4.js} +2 -2
- package/dist/{chunk-25XZKUNP.js → chunk-EQ2JTKYF.js} +1 -1
- package/dist/{chunk-25XZKUNP.js.map → chunk-EQ2JTKYF.js.map} +1 -1
- package/dist/{chunk-U5Y7C2L4.js → chunk-F6HVIPLF.js} +2 -2
- package/dist/{chunk-I2QPXPHX.cjs → chunk-GK5P55K5.cjs} +3 -3
- package/dist/{chunk-I2QPXPHX.cjs.map → chunk-GK5P55K5.cjs.map} +1 -1
- package/dist/{chunk-FMU74VA6.cjs → chunk-GUROIWJY.cjs} +1 -1
- package/dist/{chunk-FMU74VA6.cjs.map → chunk-GUROIWJY.cjs.map} +1 -1
- package/dist/{chunk-IQHYZG2K.cjs → chunk-KAJ3GVK2.cjs} +6 -6
- package/dist/{chunk-IQHYZG2K.cjs.map → chunk-KAJ3GVK2.cjs.map} +1 -1
- package/dist/{chunk-HBIIWBB5.js → chunk-KCKZHLI5.js} +2 -2
- package/dist/chunk-KFDDI4LH.cjs +35 -0
- package/dist/{chunk-X6CI7GWV.cjs.map → chunk-KFDDI4LH.cjs.map} +1 -1
- package/dist/{chunk-MMXKQUAS.cjs → chunk-M3TVDUGX.cjs} +4 -4
- package/dist/{chunk-MMXKQUAS.cjs.map → chunk-M3TVDUGX.cjs.map} +1 -1
- package/dist/{chunk-ITDTGCLJ.js → chunk-PEBD5XTD.js} +2 -2
- package/dist/chunk-UJ3D4DYP.cjs +33 -0
- package/dist/{chunk-33SLJJSZ.cjs.map → chunk-UJ3D4DYP.cjs.map} +1 -1
- package/dist/{chunk-VDLHT5CW.cjs → chunk-UWFI3XV7.cjs} +16 -16
- package/dist/{chunk-VDLHT5CW.cjs.map → chunk-UWFI3XV7.cjs.map} +1 -1
- package/dist/{chunk-54TSHDNC.cjs → chunk-VBHUVDW4.cjs} +115 -54
- package/dist/chunk-VBHUVDW4.cjs.map +1 -0
- package/dist/{chunk-DAIPI5CX.js → chunk-XLTVLET5.js} +2 -2
- package/dist/chunk-YA64BEKC.cjs +31 -0
- package/dist/{chunk-HTCGXDEG.cjs.map → chunk-YA64BEKC.cjs.map} +1 -1
- package/dist/{chunk-JE2MK4CC.js → chunk-YH77XVJB.js} +101 -40
- package/dist/chunk-YH77XVJB.js.map +1 -0
- package/dist/html.cjs +10 -10
- package/dist/html.js +5 -5
- package/dist/index.cjs +18 -18
- package/dist/index.js +8 -8
- package/dist/markdown.cjs +11 -11
- package/dist/markdown.js +6 -6
- package/dist/text.cjs +8 -8
- package/dist/text.js +3 -3
- package/dist/yaml.cjs +10 -10
- package/dist/yaml.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-33SLJJSZ.cjs +0 -33
- package/dist/chunk-54TSHDNC.cjs.map +0 -1
- package/dist/chunk-HTCGXDEG.cjs +0 -31
- package/dist/chunk-JE2MK4CC.js.map +0 -1
- package/dist/chunk-X6CI7GWV.cjs +0 -35
- /package/dist/{chunk-GUTUSN4K.js.map → chunk-4RAZ2EDS.js.map} +0 -0
- /package/dist/{chunk-74I62TZ2.js.map → chunk-6UQAKZ7L.js.map} +0 -0
- /package/dist/{chunk-JVBK3LG3.js.map → chunk-EH542ZE4.js.map} +0 -0
- /package/dist/{chunk-U5Y7C2L4.js.map → chunk-F6HVIPLF.js.map} +0 -0
- /package/dist/{chunk-HBIIWBB5.js.map → chunk-KCKZHLI5.js.map} +0 -0
- /package/dist/{chunk-ITDTGCLJ.js.map → chunk-PEBD5XTD.js.map} +0 -0
- /package/dist/{chunk-DAIPI5CX.js.map → chunk-XLTVLET5.js.map} +0 -0
|
@@ -2,21 +2,21 @@ import {
|
|
|
2
2
|
htmlFragmentSpans,
|
|
3
3
|
isSkippedElement,
|
|
4
4
|
wrapParserErrors
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PEBD5XTD.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveFrontmatterKeys,
|
|
8
8
|
yamlSpans
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KCKZHLI5.js";
|
|
10
10
|
import {
|
|
11
11
|
analyzeOverUnits,
|
|
12
12
|
runOverUnits
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-F6HVIPLF.js";
|
|
14
14
|
import {
|
|
15
15
|
PolytypoError,
|
|
16
16
|
getLocaleData,
|
|
17
17
|
planRules,
|
|
18
18
|
resolveNarrowTarget
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-EQ2JTKYF.js";
|
|
20
20
|
|
|
21
21
|
// src/modes/markdown.ts
|
|
22
22
|
import { parse, postprocess, preprocess } from "micromark";
|
|
@@ -52,8 +52,14 @@ var SKIPPED_TOKEN_TYPES = /* @__PURE__ */ new Set([
|
|
|
52
52
|
// These are `micromark-extension-frontmatter`'s own token types, one per matter. An earlier
|
|
53
53
|
// revision listed `"frontmatter"`, which the extension never emits: the block was skipped only
|
|
54
54
|
// because its content arrives as `yamlValue`/`tomlValue` rather than `data`, so the entry that
|
|
55
|
-
// was supposed to do the work did none.
|
|
56
|
-
//
|
|
55
|
+
// was supposed to do the work did none.
|
|
56
|
+
//
|
|
57
|
+
// Since spec 1.8.0 the skip is 3.7.3a's mask, not this: a located block reaches the parser as
|
|
58
|
+
// blanks, so the extension cannot see one. The extension stays because it is measured inert —
|
|
59
|
+
// `tests/modes/frontmatter-keys.test.ts` asserts over every edge document that it never finds
|
|
60
|
+
// a block the scan denies — and because removing a working locator that costs nothing would be
|
|
61
|
+
// a change with no problem behind it. What the test would catch is the case that would matter:
|
|
62
|
+
// the two disagreeing about whether a document has a block at all.
|
|
57
63
|
"yaml",
|
|
58
64
|
"toml"
|
|
59
65
|
]);
|
|
@@ -126,8 +132,63 @@ function extensionsFor(dialect) {
|
|
|
126
132
|
const fm = frontmatter([...FRONTMATTER_MATTERS]);
|
|
127
133
|
return dialect === "mdx" ? [fm, gfm(), mdxjs()] : [fm, gfm()];
|
|
128
134
|
}
|
|
135
|
+
var YAML_DELIMITER = "---";
|
|
136
|
+
var TOML_DELIMITER = "+++";
|
|
137
|
+
var TAB = 9;
|
|
138
|
+
var LF = 10;
|
|
139
|
+
var CR = 13;
|
|
140
|
+
var SPACE = 32;
|
|
141
|
+
var BOM = 65279;
|
|
142
|
+
function markdownLineFrom(source, start) {
|
|
143
|
+
for (let i = start; i < source.length; i += 1) {
|
|
144
|
+
const unit = source.charCodeAt(i);
|
|
145
|
+
if (unit === LF) return { end: i, next: i + 1 };
|
|
146
|
+
if (unit === CR) return { end: i, next: source.charCodeAt(i + 1) === LF ? i + 2 : i + 1 };
|
|
147
|
+
}
|
|
148
|
+
return { end: source.length, next: source.length };
|
|
149
|
+
}
|
|
150
|
+
function isBlankRun(source, from, to) {
|
|
151
|
+
for (let i = from; i < to; i += 1) {
|
|
152
|
+
const unit = source.charCodeAt(i);
|
|
153
|
+
if (unit !== SPACE && unit !== TAB) return false;
|
|
154
|
+
}
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
function isDelimiterLine(source, start, line, delimiter) {
|
|
158
|
+
return source.startsWith(delimiter, start) && isBlankRun(source, start + delimiter.length, line.end);
|
|
159
|
+
}
|
|
160
|
+
function locateFrontmatter(source) {
|
|
161
|
+
const start = source.charCodeAt(0) === BOM ? 1 : 0;
|
|
162
|
+
const matter = source.startsWith(YAML_DELIMITER, start) ? "yaml" : source.startsWith(TOML_DELIMITER, start) ? "toml" : null;
|
|
163
|
+
if (matter === null) return null;
|
|
164
|
+
const delimiter = matter === "yaml" ? YAML_DELIMITER : TOML_DELIMITER;
|
|
165
|
+
const opener = markdownLineFrom(source, start);
|
|
166
|
+
if (!isBlankRun(source, start + delimiter.length, opener.end)) return null;
|
|
167
|
+
const contentStart = opener.next;
|
|
168
|
+
for (let at = contentStart; at < source.length; ) {
|
|
169
|
+
const line = markdownLineFrom(source, at);
|
|
170
|
+
if (isDelimiterLine(source, at, line, delimiter)) {
|
|
171
|
+
return { matter, start, end: line.end, contentStart, contentEnd: at };
|
|
172
|
+
}
|
|
173
|
+
at = line.next;
|
|
174
|
+
}
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
function maskFrontmatter(source, block) {
|
|
178
|
+
if (block === null) return source;
|
|
179
|
+
let masked = "";
|
|
180
|
+
for (let i = 0; i < block.end; i += 1) {
|
|
181
|
+
const unit = source.charCodeAt(i);
|
|
182
|
+
masked += unit === LF || unit === CR ? source[i] : " ";
|
|
183
|
+
}
|
|
184
|
+
return masked + source.slice(block.end);
|
|
185
|
+
}
|
|
129
186
|
function markdownSpans(source, dialect) {
|
|
130
|
-
const
|
|
187
|
+
const block = locateFrontmatter(source);
|
|
188
|
+
const masked = maskFrontmatter(source, block);
|
|
189
|
+
const shift = masked.charCodeAt(0) === BOM ? 1 : 0;
|
|
190
|
+
const text = shift === 0 ? masked : masked.slice(shift);
|
|
191
|
+
const events = wrapParserErrors(dialect, () => tokenize(text, extensionsFor(dialect)));
|
|
131
192
|
const spans = [];
|
|
132
193
|
const elementStack = [];
|
|
133
194
|
let skipDepth = 0;
|
|
@@ -141,7 +202,7 @@ function markdownSpans(source, dialect) {
|
|
|
141
202
|
if (kind === "enter") {
|
|
142
203
|
updateElementStack(
|
|
143
204
|
elementStack,
|
|
144
|
-
|
|
205
|
+
text.slice(token.start.offset, token.end.offset),
|
|
145
206
|
type !== "htmlText"
|
|
146
207
|
);
|
|
147
208
|
}
|
|
@@ -151,8 +212,8 @@ function markdownSpans(source, dialect) {
|
|
|
151
212
|
if (type === "htmlFlow") {
|
|
152
213
|
if (kind === "enter" && skipDepth === 0 && elementStack.length === 0) {
|
|
153
214
|
for (const span of htmlFragmentSpans(
|
|
154
|
-
|
|
155
|
-
token.start.offset
|
|
215
|
+
text.slice(token.start.offset, token.end.offset),
|
|
216
|
+
token.start.offset + shift
|
|
156
217
|
)) {
|
|
157
218
|
spans.push(span);
|
|
158
219
|
}
|
|
@@ -161,40 +222,40 @@ function markdownSpans(source, dialect) {
|
|
|
161
222
|
continue;
|
|
162
223
|
}
|
|
163
224
|
if (kind === "enter" && type === "data" && skipDepth === 0 && elementStack.length === 0) {
|
|
164
|
-
spans.push({ start: token.start.offset, end: token.end.offset });
|
|
225
|
+
spans.push({ start: token.start.offset + shift, end: token.end.offset + shift });
|
|
165
226
|
}
|
|
166
227
|
}
|
|
167
|
-
return spans;
|
|
228
|
+
if (block === null) return spans;
|
|
229
|
+
return spans.flatMap((span) => {
|
|
230
|
+
if (span.start >= block.end) return [span];
|
|
231
|
+
if (span.end <= block.end) return [];
|
|
232
|
+
return [{ start: block.end, end: span.end }];
|
|
233
|
+
});
|
|
168
234
|
}
|
|
169
|
-
function
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
if (kind === "enter") {
|
|
180
|
-
inBlock = true;
|
|
181
|
-
continue;
|
|
235
|
+
function declinedContentRanges(content) {
|
|
236
|
+
const declined = [];
|
|
237
|
+
let start = 0;
|
|
238
|
+
while (start < content.length) {
|
|
239
|
+
const lf = content.indexOf("\n", start);
|
|
240
|
+
const next = lf === -1 ? content.length : lf + 1;
|
|
241
|
+
for (let i = start; i < next; i += 1) {
|
|
242
|
+
if (content.charCodeAt(i) === CR && content.charCodeAt(i + 1) !== LF) {
|
|
243
|
+
declined.push({ start, end: next });
|
|
244
|
+
break;
|
|
182
245
|
}
|
|
183
|
-
break;
|
|
184
246
|
}
|
|
185
|
-
|
|
186
|
-
if (kind !== "enter") continue;
|
|
187
|
-
if (type === "yamlFence") {
|
|
188
|
-
if (contentStart >= 0) contentEnd = token.start.offset;
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
if (type === "lineEnding" && contentStart < 0) contentStart = token.end.offset;
|
|
247
|
+
start = next;
|
|
192
248
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
249
|
+
return declined;
|
|
250
|
+
}
|
|
251
|
+
function frontmatterSpans(source, frontmatterKeys) {
|
|
252
|
+
if (frontmatterKeys.length === 0) return [];
|
|
253
|
+
const block = locateFrontmatter(source);
|
|
254
|
+
if (block === null || block.matter === "toml") return [];
|
|
255
|
+
const { contentStart, contentEnd } = block;
|
|
256
|
+
const content = source.slice(contentStart, contentEnd);
|
|
257
|
+
const declined = declinedContentRanges(content);
|
|
258
|
+
return yamlSpans(content, frontmatterKeys).filter((span) => !declined.some((range) => span.start < range.end && range.start < span.end)).map((span) => ({ start: span.start + contentStart, end: span.end + contentStart }));
|
|
198
259
|
}
|
|
199
260
|
|
|
200
261
|
// src/engine/markdown-pipeline.ts
|
|
@@ -210,7 +271,7 @@ function runMarkdownPipeline(input, options) {
|
|
|
210
271
|
function unitsOf(input, dialect, frontmatterKeys) {
|
|
211
272
|
const body = markdownSpans(input, dialect);
|
|
212
273
|
if (frontmatterKeys === void 0) return [body];
|
|
213
|
-
return [frontmatterSpans(input,
|
|
274
|
+
return [frontmatterSpans(input, frontmatterKeys), body];
|
|
214
275
|
}
|
|
215
276
|
function analyzeMarkdownPipeline(input, options) {
|
|
216
277
|
const narrowTarget = resolveNarrowTarget(options.narrowNbsp);
|
|
@@ -232,4 +293,4 @@ export {
|
|
|
232
293
|
runMarkdownPipeline,
|
|
233
294
|
analyzeMarkdownPipeline
|
|
234
295
|
};
|
|
235
|
-
//# sourceMappingURL=chunk-
|
|
296
|
+
//# sourceMappingURL=chunk-YH77XVJB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/modes/markdown.ts","../src/engine/markdown-pipeline.ts"],"sourcesContent":["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 { yamlSpans } from \"./yaml.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 // modes.md 3.7.3, and it matters: without it the second `---` of a YAML block reads as a setext\n // underline, `title: Une note` becomes a paragraph, and `fr` puts a narrow no-break space in\n // front of the colon of a machine-read metadata field. Covered by conformance fixtures\n // en-us-markdown-{commonmark,mdx}-frontmatter, fr-markdown-{commonmark,mdx}-frontmatter-nbsp,\n // en-us-markdown-commonmark-frontmatter-toml and -frontmatter-unterminated.\n //\n // These are `micromark-extension-frontmatter`'s own token types, one per matter. An earlier\n // revision listed `\"frontmatter\"`, which the extension never emits: the block was skipped only\n // because its content arrives as `yamlValue`/`tomlValue` rather than `data`, so the entry that\n // was supposed to do the work did none.\n //\n // Since spec 1.8.0 the skip is 3.7.3a's mask, not this: a located block reaches the parser as\n // blanks, so the extension cannot see one. The extension stays because it is measured inert —\n // `tests/modes/frontmatter-keys.test.ts` asserts over every edge document that it never finds\n // a block the scan denies — and because removing a working locator that costs nothing would be\n // a change with no problem behind it. What the test would catch is the case that would matter:\n // the two disagreeing about whether a document has a block at all.\n \"yaml\",\n \"toml\",\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\n// modes.md 3.7.3 names both frontmatter delimiters, `---` (YAML) and `+++` (TOML), and skips\n// either whole. micromark's default matter is YAML alone, so both must be asked for by name: with\n// the default, a `+++` block parses as prose and the machine-read fields inside it get typeset.\nconst FRONTMATTER_MATTERS = [\"yaml\", \"toml\"] as const;\n\nexport function extensionsFor(dialect: Dialect): Extension[] {\n const fm = frontmatter([...FRONTMATTER_MATTERS]);\n return dialect === \"mdx\" ? [fm, gfm(), mdxjs()] : [fm, gfm()];\n}\n\n// modes.md 3.7.3a, spec 1.8.0: where the frontmatter block begins and ends, decided by the scan\n// below and by nothing else. Four runtimes reached the construct through four parsers and got four\n// answers — two of them typeset `date: \"2026-09-26\"` over one trailing space on a fence — so the\n// section makes this scan normative and a parser's opinion a thing measured against it. Locating\n// the block here is also what lets `frontmatterSpans` stop parsing the document a second time\n// (polytypo/polytypo#59).\nconst YAML_DELIMITER = \"---\";\nconst TOML_DELIMITER = \"+++\";\n\nconst TAB = 0x09;\nconst LF = 0x0a;\nconst CR = 0x0d;\nconst SPACE = 0x20;\nconst BOM = 0xfeff;\n\ninterface SourceLine {\n /** Index just past the line's content: the terminator, or the end of the source. */\n readonly end: number;\n /** Index the next line starts at, or the end of the source when this line is the last. */\n readonly next: number;\n}\n\n/**\n * 3.7.3a step 5: **CommonMark's** line, not 3.8.4's. A line ends at U+000A, at a U+000D that is\n * not followed by U+000A, or at the end of input, and the terminator is never part of the line.\n * The block is a Markdown construct and ends its lines the way the language around it does; the\n * YAML inside it keeps 3.8.4's LF-only model (`./yaml.js`), and the two are different on purpose —\n * harmonising them silently changes one of them.\n */\nfunction markdownLineFrom(source: string, start: number): SourceLine {\n for (let i = start; i < source.length; i += 1) {\n const unit = source.charCodeAt(i);\n if (unit === LF) return { end: i, next: i + 1 };\n if (unit === CR) return { end: i, next: source.charCodeAt(i + 1) === LF ? i + 2 : i + 1 };\n }\n return { end: source.length, next: source.length };\n}\n\n/** 3.7.3a steps 2 and 3: what a delimiter line may carry after the delimiter, and nothing else. */\nfunction isBlankRun(source: string, from: number, to: number): boolean {\n for (let i = from; i < to; i += 1) {\n const unit = source.charCodeAt(i);\n if (unit !== SPACE && unit !== TAB) return false;\n }\n return true;\n}\n\n/**\n * A delimiter line: the delimiter at the line's first code point — indentation disqualifies it —\n * then U+0020 and U+0009 to the end of the line. A fourth delimiter character is not whitespace,\n * so `----` is neither an opener nor a closer.\n */\nfunction isDelimiterLine(\n source: string,\n start: number,\n line: SourceLine,\n delimiter: string,\n): boolean {\n return (\n source.startsWith(delimiter, start) && isBlankRun(source, start + delimiter.length, line.end)\n );\n}\n\n/** modes.md 3.7.3a. The frontmatter block's extent, in source offsets. */\nexport interface FrontmatterBlock {\n /** Which matter the delimiter names. TOML yields no spans either way (3.7.4). */\n readonly matter: \"yaml\" | \"toml\";\n /** First code point of the opening delimiter: 0, or 1 past a single leading U+FEFF (step 1). */\n readonly start: number;\n /**\n * End of the closing delimiter line's content — its trailing whitespace included, its terminator\n * excluded.\n */\n readonly end: number;\n /** 3.7.4: the code point after the opening delimiter line's terminator. */\n readonly contentStart: number;\n /** 3.7.4: the code point that begins the closing delimiter line. */\n readonly contentEnd: number;\n}\n\n/**\n * modes.md 3.7.3a, the whole of it. Offsets are UTF-16 indices, like every other mode in this\n * runtime; every code point the scan tests is ASCII or U+FEFF, so indexing by code unit and\n * indexing by code point agree on all of them.\n */\nexport function locateFrontmatter(source: string): FrontmatterBlock | null {\n // Step 1: the document must begin with the delimiter, with a single leading U+FEFF stepped over\n // first — it is a byte-order mark, not content, and reading it as content would deny the block\n // to every file some Windows editors produce.\n const start = source.charCodeAt(0) === BOM ? 1 : 0;\n const matter = source.startsWith(YAML_DELIMITER, start)\n ? \"yaml\"\n : source.startsWith(TOML_DELIMITER, start)\n ? \"toml\"\n : null;\n if (matter === null) return null;\n const delimiter = matter === \"yaml\" ? YAML_DELIMITER : TOML_DELIMITER;\n\n // Step 2: the rest of the opening line may be U+0020 and U+0009 and nothing else.\n const opener = markdownLineFrom(source, start);\n if (!isBlankRun(source, start + delimiter.length, opener.end)) return null;\n\n // Step 3: the closing line is the first LATER line of the same delimiter. Step 4: with none,\n // there is no block, and the opening delimiter is whatever the dialect makes of it.\n const contentStart = opener.next;\n for (let at = contentStart; at < source.length;) {\n const line = markdownLineFrom(source, at);\n if (isDelimiterLine(source, at, line, delimiter)) {\n return { matter, start, end: line.end, contentStart, contentEnd: at };\n }\n at = line.next;\n }\n return null;\n}\n\n/**\n * modes.md 3.7.3a: **the parser is handed the block masked out** — the located block, both\n * delimiter lines included and step 1's leading U+FEFF with them, replaced by U+0020, with line\n * terminators kept as they are. The mark is in that list because without it the first line is not\n * blank: no parser is required to strip it, and a runtime masking the block alone emits a span\n * for it.\n *\n * The invariant is that the masked source stay **positionally aligned with the original in the unit\n * this runtime maps parser offsets back through**, which here is UTF-16 code units: micromark's\n * offsets are handed straight to `Span`, so one U+0020 per code unit is what JS owes. An astral\n * character therefore masks to two spaces, not one. It is deliberately not stated as a count of\n * code points — a runtime that converts offsets against the masked source first owes code-point\n * alignment instead, and both are conformant.\n *\n * Suppressing spans inside the block's range instead is not equivalent, and the runtime that did\n * that is measured in 3.7.3a: a fence inside a metadata value pairs with the body's own, and the\n * body's code block and its prose swap roles — or, with nothing to pair with, swallows the rest of\n * the document. The damage is in what the parser concluded, so no span-level check can see it.\n *\n * Masking is also what keeps 3.7.4's two text units disjoint now that the extent is the scan's and\n * not the parser's: the body cannot emit a span inside a block the parser was never shown.\n */\nfunction maskFrontmatter(source: string, block: FrontmatterBlock | null): string {\n if (block === null) return source;\n let masked = \"\";\n for (let i = 0; i < block.end; i += 1) {\n const unit = source.charCodeAt(i);\n masked += unit === LF || unit === CR ? source[i] : \" \";\n }\n return masked + source.slice(block.end);\n}\n\n/**\n * modes.md 3.7. The body's spans. The document reaches the parser with its frontmatter block\n * masked out (3.7.3a), so the block is skipped because the scan located it, not because an\n * extension recognised it — and `text` below is what the token offsets refer to.\n *\n * Two corrections sit between `text` and the spans this returns:\n *\n * - **`shift`**: micromark's `preprocess` drops a leading U+FEFF and then reports offsets against\n * the shortened string, so every span in a document carrying one lands a code unit to the left —\n * which ate the last code point of every span and left\n * `en-us-markdown-commonmark-byte-order-mark-no-block` unconverted in full. The mark is removed\n * here instead, and the difference added back. A document whose block was located needs no such\n * correction, because 3.7.3a masks the mark along with the block;\n * - **the no-span rule** (3.7.3a): no span may lie inside the block whatever the parser made of the\n * masked text. A span straddling the block's end is **clipped** to the part outside it, and\n * dropped only when nothing is left, so body prose past the block cannot be lost to a parser's\n * mistake\n * about where the block ended. Masking is what makes this inert for micromark — measured over\n * nineteen block shapes in both dialects, it emits nothing inside a masked block — and the spec\n * states the rule separately because it is not true of every parser.\n */\nexport function markdownSpans(source: string, dialect: Dialect): Span[] {\n const block = locateFrontmatter(source);\n const masked = maskFrontmatter(source, block);\n const shift = masked.charCodeAt(0) === BOM ? 1 : 0;\n const text = shift === 0 ? masked : masked.slice(shift);\n const events = wrapParserErrors(dialect, () => tokenize(text, 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 text.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 text.slice(token.start.offset, token.end.offset),\n token.start.offset + shift,\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 + shift, end: token.end.offset + shift });\n }\n }\n\n if (block === null) return spans;\n return spans.flatMap((span) => {\n if (span.start >= block.end) return [span];\n if (span.end <= block.end) return [];\n return [{ start: block.end, end: span.end }];\n });\n}\n\n/**\n * modes.md 3.7.4: **a content line containing a U+000D not followed by U+000A yields no spans**,\n * \"exactly as 3.8.4 step 1 already declines a line containing U+0009\". The two line models meet in\n * the block content and do not compose — 3.7.3a step 5 finds a block in a lone-U+000D document, and\n * 3.8.4's LF-only scan then reads the whole of it as one line. Measured, letting it through is not\n * merely inert: marks pair across what were two mapping lines, an unlisted line inside the listed\n * key's scalar takes `fr`'s spacing, and the U+000D itself lands inside a span — which 3.8.4\n * forbids.\n *\n * The decline **drops the spans the content scan produced for that line and does not alter the\n * content the scan is given**. Substituting each lone U+000D for a character 3.8.4 already\n * declines is the shortcut three ports reached for, this one included, and it is measured not\n * equivalent: the substitution moves the character onto a line of its own and can end a value run.\n * Both shapes are pinned as fixtures, and both are decided by what `yaml` mode does with the same\n * characters, since 3.7.4 claims 3.8's scan applies verbatim:\n *\n * - `title: a \"b\"\\nslug: c \"d\"\\n\\r` — the content-final U+000D is a blank line joining `slug`'s\n * value run, so 3.8.6's continuation bail declines `slug`. As a U+0009 it is a line with a tab\n * in it, not a blank one, the run ends and `slug` converts. `yaml` mode converts `title` only,\n * in both shipped runtimes measured;\n * - `summary: a\\rb\\n title: c -- d\\n` — the indented line is inside `summary`'s value run, so\n * `title` is not a key at all. Substitution ends the run and invents one.\n *\n * **The window runs to the start of the next line, not to the end of this one**, because 3.8.4's\n * own splitter treats a trailing U+000D as a terminator without a U+000A after it — so a block\n * whose single line ends in one looks clean if the terminator is excluded.\n */\nfunction declinedContentRanges(content: string): readonly Span[] {\n const declined: Span[] = [];\n let start = 0;\n while (start < content.length) {\n const lf = content.indexOf(\"\\n\", start);\n const next = lf === -1 ? content.length : lf + 1;\n for (let i = start; i < next; i += 1) {\n if (content.charCodeAt(i) === CR && content.charCodeAt(i + 1) !== LF) {\n declined.push({ start, end: next });\n break;\n }\n }\n start = next;\n }\n return declined;\n}\n\n/**\n * modes.md 3.7.4, spec 1.7.0. The frontmatter block's own spans, which form a **second text\n * unit**: the pipeline runs over them separately from the body's, so an unbalanced mark in a\n * metadata field can never pair with one in the first paragraph and this option cannot change a\n * byte outside the block.\n *\n * The block is located by `locateFrontmatter` (3.7.3a, spec 1.8.0) rather than by a second parse\n * of the document, which is both what polytypo/polytypo#59 reported and, since 1.8.0, the wrong\n * authority: the scan owns the extent and a parser is measured against it.\n *\n * Spans inside it are taken by the scan of modes.md 3.8 — frontmatter *is* YAML, and specifying it\n * twice is how two implementations of one grammar drift — with `frontmatterKeys` as step 8's key\n * predicate.\n *\n * A TOML block yields nothing, with the option or without it: TOML's quoting is a second grammar\n * this scan does not claim (modes.md §7.13). So does any content line carrying a lone U+000D — see\n * `declinedContentRanges`, which filters what the scan produced rather than changing what it reads.\n */\nexport function frontmatterSpans(source: string, frontmatterKeys: readonly string[]): Span[] {\n if (frontmatterKeys.length === 0) return [];\n const block = locateFrontmatter(source);\n if (block === null || block.matter === \"toml\") return [];\n\n const { contentStart, contentEnd } = block;\n const content = source.slice(contentStart, contentEnd);\n const declined = declinedContentRanges(content);\n\n return (\n yamlSpans(content, frontmatterKeys)\n // 3.7.4: a span reaching a declined position is dropped whole rather than trimmed.\n .filter((span) => !declined.some((range) => span.start < range.end && range.start < span.end))\n .map((span) => ({ start: span.start + contentStart, end: span.end + contentStart }))\n );\n}\n","import { frontmatterSpans, markdownSpans, resolveDialect } from \"../modes/markdown.js\";\nimport type { Dialect, Options } from \"../types.js\";\nimport { getLocaleData } from \"./locale.js\";\nimport { resolveNarrowTarget } from \"./narrow-target.js\";\nimport { planRules } from \"./rule-runner.js\";\nimport { resolveFrontmatterKeys } from \"./yaml-keys.js\";\nimport { analyzeOverUnits, runOverUnits } from \"./span-runner.js\";\nimport type { Change } from \"./origin.js\";\nimport type { Span } from \"../modes/spans.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 narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n const dialect = resolveDialect(options.dialect);\n const frontmatterKeys = resolveFrontmatterKeys(options.frontmatterKeys);\n const units = unitsOf(input, dialect, frontmatterKeys);\n return runOverUnits(input, units, planned, locale, \"markdown\", narrowTarget);\n}\n\n/**\n * modes.md 3.7.4: the body, and — only when the caller named frontmatter keys — the frontmatter\n * block as a second text unit. Without the option this is exactly the single unit every document\n * had before spec 1.7.0, which is why no released output can move.\n *\n * The two units must be **disjoint** — 3.7.4: \"no source position can belong to both units\". Since\n * spec 1.8.0 that is 3.7.3a's masking rule doing the work rather than a shared parser: the body is\n * read from a document whose block is blanked out, so it cannot emit a span the frontmatter unit\n * also claims, whatever the parser would have made of the block's characters.\n */\nfunction unitsOf(\n input: string,\n dialect: Dialect,\n frontmatterKeys: readonly string[] | undefined,\n): Span[][] {\n const body = markdownSpans(input, dialect);\n if (frontmatterKeys === undefined) return [body];\n return [frontmatterSpans(input, frontmatterKeys), body];\n}\n\n/** analyze.md §1, `markdown` mode. Dialect validation happens here exactly as it does for\n * `runMarkdownPipeline`, so an absent dialect throws POLYTYPO_INVALID_DIALECT from `analyze`\n * too (analyze.md §4 A1). */\nexport function analyzeMarkdownPipeline(input: string, options: Partial<Options>): Change[] {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n const dialect = resolveDialect(options.dialect);\n const frontmatterKeys = resolveFrontmatterKeys(options.frontmatterKeys);\n return analyzeOverUnits(\n input,\n unitsOf(input, dialect, frontmatterKeys),\n planned,\n locale,\n \"markdown\",\n narrowTarget,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,OAAO,aAAa,kBAAkB;AAC/C,SAAS,mBAAmB;AAC5B,SAAS,WAAW;AACpB,SAAS,aAAa;AAiBtB,IAAM,sBAA2C,oBAAI,IAAI;AAAA;AAAA,EAEvD;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA;AAAA,EACA;AACF,CAAC;AAGD,IAAM,sBAA2C,oBAAI,IAAI;AAAA,EACvD;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,IAAM,YAAY;AAClB,IAAM,eAAe;AACrB,IAAM,QAAQ;AACd,IAAM,cAAc;AACpB,IAAM,WAAW;AAEjB,SAAS,cAAc,MAAuB;AAC5C,SAAQ,QAAQ,MAAQ,QAAQ,OAAU,QAAQ,MAAQ,QAAQ;AACpE;AAEA,SAAS,cAAc,MAAuB;AAI5C,SACE,SAAS,gBACT,SAAS,SACT,SAAS,MACT,SAAS,KACT,SAAS,MACT,SAAS;AAEb;AAGA,SAAS,WAAW,OAAuB;AACzC,MAAI,MAAM;AACV,WAAS,IAA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,QAAQ,OAAO,SAAS,eAAe;AACrD,SAAO,aAAa,OAAO,OAAO,SAAS,QAAQ,YAAY,YAAY;AAC7E;AAYA,SAAS,QACP,OACA,SACA,iBACU;AACV,QAAM,OAAO,cAAc,OAAO,OAAO;AACzC,MAAI,oBAAoB,OAAW,QAAO,CAAC,IAAI;AAC/C,SAAO,CAAC,iBAAiB,OAAO,eAAe,GAAG,IAAI;AACxD;AAKO,SAAS,wBAAwB,OAAe,SAAqC;AAC1F,QAAM,eAAe,oBAAoB,QAAQ,UAAU;AAC3D,QAAM,UAAU,UAAU,QAAQ,KAAK;AACvC,QAAM,SAAS,cAAc,QAAQ,MAAM;AAC3C,QAAM,UAAU,eAAe,QAAQ,OAAO;AAC9C,QAAM,kBAAkB,uBAAuB,QAAQ,eAAe;AACtE,SAAO;AAAA,IACL;AAAA,IACA,QAAQ,OAAO,SAAS,eAAe;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
package/dist/html.cjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
4
|
+
var _chunkUJ3D4DYPcjs = require('./chunk-UJ3D4DYP.cjs');
|
|
5
|
+
require('./chunk-M3TVDUGX.cjs');
|
|
6
|
+
require('./chunk-UWFI3XV7.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkGK5P55K5cjs = require('./chunk-GK5P55K5.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkGUROIWJYcjs = require('./chunk-GUROIWJY.cjs');
|
|
13
13
|
|
|
14
14
|
// src/index.html.ts
|
|
15
15
|
function transform(input, options) {
|
|
16
16
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
17
|
-
|
|
18
|
-
return
|
|
17
|
+
_chunkGK5P55K5cjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
|
|
18
|
+
return _chunkUJ3D4DYPcjs.runHtmlPipeline.call(void 0, input, given);
|
|
19
19
|
}
|
|
20
20
|
function analyze(input, options) {
|
|
21
21
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
22
|
-
|
|
23
|
-
return
|
|
22
|
+
_chunkGK5P55K5cjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
|
|
23
|
+
return _chunkUJ3D4DYPcjs.analyzeHtmlPipeline.call(void 0, input, given);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
exports.PolytypoError =
|
|
29
|
+
exports.PolytypoError = _chunkGUROIWJYcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
30
30
|
//# sourceMappingURL=html.cjs.map
|
package/dist/html.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeHtmlPipeline,
|
|
3
3
|
runHtmlPipeline
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-4RAZ2EDS.js";
|
|
5
|
+
import "./chunk-PEBD5XTD.js";
|
|
6
|
+
import "./chunk-F6HVIPLF.js";
|
|
7
7
|
import {
|
|
8
8
|
assertFixedMode
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EH542ZE4.js";
|
|
10
10
|
import {
|
|
11
11
|
PolytypoError
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-EQ2JTKYF.js";
|
|
13
13
|
|
|
14
14
|
// src/index.html.ts
|
|
15
15
|
function transform(input, options) {
|
package/dist/index.cjs
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkYA64BEKCcjs = require('./chunk-YA64BEKC.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkUJ3D4DYPcjs = require('./chunk-UJ3D4DYP.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
12
|
+
var _chunkVBHUVDW4cjs = require('./chunk-VBHUVDW4.cjs');
|
|
13
|
+
require('./chunk-M3TVDUGX.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
18
|
-
require('./chunk-
|
|
19
|
-
require('./chunk-
|
|
17
|
+
var _chunkKFDDI4LHcjs = require('./chunk-KFDDI4LH.cjs');
|
|
18
|
+
require('./chunk-KAJ3GVK2.cjs');
|
|
19
|
+
require('./chunk-UWFI3XV7.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkGUROIWJYcjs = require('./chunk-GUROIWJY.cjs');
|
|
23
23
|
|
|
24
24
|
// src/engine/pipeline.ts
|
|
25
25
|
function resolveMode(mode) {
|
|
26
26
|
if (mode === void 0 || mode === "text") return "text";
|
|
27
27
|
if (mode === "html" || mode === "markdown" || mode === "yaml") return mode;
|
|
28
|
-
throw new (0,
|
|
28
|
+
throw new (0, _chunkGUROIWJYcjs.PolytypoError)(
|
|
29
29
|
"POLYTYPO_INVALID_MODE",
|
|
30
30
|
`Unknown mode "${String(mode)}". Expected "text", "html", "markdown" or "yaml".`
|
|
31
31
|
);
|
|
@@ -33,18 +33,18 @@ function resolveMode(mode) {
|
|
|
33
33
|
function runPipeline(input, options) {
|
|
34
34
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
35
35
|
const mode = resolveMode(given.mode);
|
|
36
|
-
if (mode === "text") return
|
|
37
|
-
if (mode === "html") return
|
|
38
|
-
if (mode === "yaml") return
|
|
39
|
-
return
|
|
36
|
+
if (mode === "text") return _chunkYA64BEKCcjs.runTextPipeline.call(void 0, input, given);
|
|
37
|
+
if (mode === "html") return _chunkUJ3D4DYPcjs.runHtmlPipeline.call(void 0, input, given);
|
|
38
|
+
if (mode === "yaml") return _chunkKFDDI4LHcjs.runYamlPipeline.call(void 0, input, given);
|
|
39
|
+
return _chunkVBHUVDW4cjs.runMarkdownPipeline.call(void 0, input, given);
|
|
40
40
|
}
|
|
41
41
|
function runAnalyze(input, options) {
|
|
42
42
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
43
43
|
const mode = resolveMode(given.mode);
|
|
44
|
-
if (mode === "text") return
|
|
45
|
-
if (mode === "html") return
|
|
46
|
-
if (mode === "yaml") return
|
|
47
|
-
return
|
|
44
|
+
if (mode === "text") return _chunkYA64BEKCcjs.analyzeTextPipeline.call(void 0, input, given);
|
|
45
|
+
if (mode === "html") return _chunkUJ3D4DYPcjs.analyzeHtmlPipeline.call(void 0, input, given);
|
|
46
|
+
if (mode === "yaml") return _chunkKFDDI4LHcjs.analyzeYamlPipeline.call(void 0, input, given);
|
|
47
|
+
return _chunkVBHUVDW4cjs.analyzeMarkdownPipeline.call(void 0, input, given);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// src/index.ts
|
|
@@ -58,5 +58,5 @@ function analyze(input, options) {
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.PolytypoError =
|
|
61
|
+
exports.PolytypoError = _chunkGUROIWJYcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
62
62
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeTextPipeline,
|
|
3
3
|
runTextPipeline
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XLTVLET5.js";
|
|
5
5
|
import {
|
|
6
6
|
analyzeHtmlPipeline,
|
|
7
7
|
runHtmlPipeline
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-4RAZ2EDS.js";
|
|
9
9
|
import {
|
|
10
10
|
analyzeMarkdownPipeline,
|
|
11
11
|
runMarkdownPipeline
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-YH77XVJB.js";
|
|
13
|
+
import "./chunk-PEBD5XTD.js";
|
|
14
14
|
import {
|
|
15
15
|
analyzeYamlPipeline,
|
|
16
16
|
runYamlPipeline
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-6UQAKZ7L.js";
|
|
18
|
+
import "./chunk-KCKZHLI5.js";
|
|
19
|
+
import "./chunk-F6HVIPLF.js";
|
|
20
20
|
import {
|
|
21
21
|
PolytypoError
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-EQ2JTKYF.js";
|
|
23
23
|
|
|
24
24
|
// src/engine/pipeline.ts
|
|
25
25
|
function resolveMode(mode) {
|
package/dist/markdown.cjs
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
4
|
+
var _chunkVBHUVDW4cjs = require('./chunk-VBHUVDW4.cjs');
|
|
5
|
+
require('./chunk-M3TVDUGX.cjs');
|
|
6
|
+
require('./chunk-KAJ3GVK2.cjs');
|
|
7
|
+
require('./chunk-UWFI3XV7.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkGK5P55K5cjs = require('./chunk-GK5P55K5.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkGUROIWJYcjs = require('./chunk-GUROIWJY.cjs');
|
|
14
14
|
|
|
15
15
|
// src/index.markdown.ts
|
|
16
16
|
function transform(input, options) {
|
|
17
17
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
18
|
-
|
|
19
|
-
return
|
|
18
|
+
_chunkGK5P55K5cjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
|
|
19
|
+
return _chunkVBHUVDW4cjs.runMarkdownPipeline.call(void 0, input, given);
|
|
20
20
|
}
|
|
21
21
|
function analyze(input, options) {
|
|
22
22
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
23
|
-
|
|
24
|
-
return
|
|
23
|
+
_chunkGK5P55K5cjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
|
|
24
|
+
return _chunkVBHUVDW4cjs.analyzeMarkdownPipeline.call(void 0, input, given);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
exports.PolytypoError =
|
|
30
|
+
exports.PolytypoError = _chunkGUROIWJYcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
31
31
|
//# sourceMappingURL=markdown.cjs.map
|
package/dist/markdown.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeMarkdownPipeline,
|
|
3
3
|
runMarkdownPipeline
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-YH77XVJB.js";
|
|
5
|
+
import "./chunk-PEBD5XTD.js";
|
|
6
|
+
import "./chunk-KCKZHLI5.js";
|
|
7
|
+
import "./chunk-F6HVIPLF.js";
|
|
8
8
|
import {
|
|
9
9
|
assertFixedMode
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EH542ZE4.js";
|
|
11
11
|
import {
|
|
12
12
|
PolytypoError
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-EQ2JTKYF.js";
|
|
14
14
|
|
|
15
15
|
// src/index.markdown.ts
|
|
16
16
|
function transform(input, options) {
|
package/dist/text.cjs
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkYA64BEKCcjs = require('./chunk-YA64BEKC.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkGK5P55K5cjs = require('./chunk-GK5P55K5.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkGUROIWJYcjs = require('./chunk-GUROIWJY.cjs');
|
|
11
11
|
|
|
12
12
|
// src/index.text.ts
|
|
13
13
|
function transform(input, options) {
|
|
14
14
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
15
|
-
|
|
16
|
-
return
|
|
15
|
+
_chunkGK5P55K5cjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
|
|
16
|
+
return _chunkYA64BEKCcjs.runTextPipeline.call(void 0, input, given);
|
|
17
17
|
}
|
|
18
18
|
function analyze(input, options) {
|
|
19
19
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
20
|
-
|
|
21
|
-
return
|
|
20
|
+
_chunkGK5P55K5cjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
|
|
21
|
+
return _chunkYA64BEKCcjs.analyzeTextPipeline.call(void 0, input, given);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
exports.PolytypoError =
|
|
27
|
+
exports.PolytypoError = _chunkGUROIWJYcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
28
28
|
//# sourceMappingURL=text.cjs.map
|
package/dist/text.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeTextPipeline,
|
|
3
3
|
runTextPipeline
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XLTVLET5.js";
|
|
5
5
|
import {
|
|
6
6
|
assertFixedMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EH542ZE4.js";
|
|
8
8
|
import {
|
|
9
9
|
PolytypoError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EQ2JTKYF.js";
|
|
11
11
|
|
|
12
12
|
// src/index.text.ts
|
|
13
13
|
function transform(input, options) {
|
package/dist/yaml.cjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
4
|
+
var _chunkKFDDI4LHcjs = require('./chunk-KFDDI4LH.cjs');
|
|
5
|
+
require('./chunk-KAJ3GVK2.cjs');
|
|
6
|
+
require('./chunk-UWFI3XV7.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkGK5P55K5cjs = require('./chunk-GK5P55K5.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkGUROIWJYcjs = require('./chunk-GUROIWJY.cjs');
|
|
13
13
|
|
|
14
14
|
// src/index.yaml.ts
|
|
15
15
|
function transform(input, options) {
|
|
16
16
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
17
|
-
|
|
18
|
-
return
|
|
17
|
+
_chunkGK5P55K5cjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
|
|
18
|
+
return _chunkKFDDI4LHcjs.runYamlPipeline.call(void 0, input, given);
|
|
19
19
|
}
|
|
20
20
|
function analyze(input, options) {
|
|
21
21
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
22
|
-
|
|
23
|
-
return
|
|
22
|
+
_chunkGK5P55K5cjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
|
|
23
|
+
return _chunkKFDDI4LHcjs.analyzeYamlPipeline.call(void 0, input, given);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
exports.PolytypoError =
|
|
29
|
+
exports.PolytypoError = _chunkGUROIWJYcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
30
30
|
//# sourceMappingURL=yaml.cjs.map
|