markdown-codec 11.1.9 → 11.1.10

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.
@@ -1,2 +1,2 @@
1
- import { A as MarkdownSoftBreakNode, B as isMarkdownInlineNode, C as MarkdownMathBlockNode, D as MarkdownParagraphNode, E as MarkdownOrderedListDelimiter, F as MarkdownTableNode, I as MarkdownTableRowNode, L as MarkdownTextNode, M as MarkdownStrongNode, N as MarkdownTableAlignment, O as MarkdownPosition, P as MarkdownTableCellNode, R as MarkdownThematicBreakNode, S as MarkdownListNode, T as MarkdownNode, _ as MarkdownImageNode, a as MarkdownCodeBlockNode, b as MarkdownListItemNode, c as MarkdownEmphasisMarker, d as MarkdownFootnoteDefinitionNode, f as MarkdownFootnoteReferenceNode, g as MarkdownHtmlBlockNode, h as MarkdownHeadingStyle, i as MarkdownBulletMarker, j as MarkdownStrikethroughNode, k as MarkdownRawHtmlNode, l as MarkdownEmphasisNode, m as MarkdownHeadingNode, n as MarkdownBlockNode, o as MarkdownCodeSpanNode, p as MarkdownHardBreakNode, r as MarkdownBlockquoteNode, s as MarkdownDocumentNode, t as MarkdownAutolinkNode, u as MarkdownEntityNode, v as MarkdownInlineNode, w as MarkdownMathInlineNode, x as MarkdownListMarkerType, y as MarkdownLinkNode, z as isMarkdownBlockNode } from "../ast-CNfTgS0N.cjs";
2
- export { MarkdownAutolinkNode, MarkdownBlockNode, MarkdownBlockquoteNode, MarkdownBulletMarker, MarkdownCodeBlockNode, MarkdownCodeSpanNode, MarkdownDocumentNode, MarkdownEmphasisMarker, MarkdownEmphasisNode, MarkdownEntityNode, MarkdownFootnoteDefinitionNode, MarkdownFootnoteReferenceNode, MarkdownHardBreakNode, MarkdownHeadingNode, MarkdownHeadingStyle, MarkdownHtmlBlockNode, MarkdownImageNode, MarkdownInlineNode, MarkdownLinkNode, MarkdownListItemNode, MarkdownListMarkerType, MarkdownListNode, MarkdownMathBlockNode, MarkdownMathInlineNode, MarkdownNode, MarkdownOrderedListDelimiter, MarkdownParagraphNode, MarkdownPosition, MarkdownRawHtmlNode, MarkdownSoftBreakNode, MarkdownStrikethroughNode, MarkdownStrongNode, MarkdownTableAlignment, MarkdownTableCellNode, MarkdownTableNode, MarkdownTableRowNode, MarkdownTextNode, MarkdownThematicBreakNode, isMarkdownBlockNode, isMarkdownInlineNode };
1
+ import { A as MarkdownRawHtmlNode, B as isMarkdownBlockNode, C as MarkdownListNode, D as MarkdownOrderedListDelimiter, E as MarkdownNode, F as MarkdownTableCellNode, I as MarkdownTableNode, L as MarkdownTableRowNode, M as MarkdownStrikethroughNode, N as MarkdownStrongNode, O as MarkdownParagraphNode, P as MarkdownTableAlignment, R as MarkdownTextNode, S as MarkdownListMarkerType, T as MarkdownMathInlineNode, V as isMarkdownInlineNode, _ as MarkdownHtmlBlockNode, a as MarkdownCodeBlockNode, b as MarkdownLinkNode, c as MarkdownEmphasisMarker, d as MarkdownFootnoteDefinitionNode, f as MarkdownFootnoteReferenceNode, g as MarkdownHeadingStyle, h as MarkdownHeadingNode, i as MarkdownBulletMarker, j as MarkdownSoftBreakNode, k as MarkdownPosition, l as MarkdownEmphasisNode, m as MarkdownHeadingLevel, n as MarkdownBlockNode, o as MarkdownCodeSpanNode, p as MarkdownHardBreakNode, r as MarkdownBlockquoteNode, s as MarkdownDocumentNode, t as MarkdownAutolinkNode, u as MarkdownEntityNode, v as MarkdownImageNode, w as MarkdownMathBlockNode, x as MarkdownListItemNode, y as MarkdownInlineNode, z as MarkdownThematicBreakNode } from "../ast-DI-t9uKv.cjs";
2
+ export { MarkdownAutolinkNode, MarkdownBlockNode, MarkdownBlockquoteNode, MarkdownBulletMarker, MarkdownCodeBlockNode, MarkdownCodeSpanNode, MarkdownDocumentNode, MarkdownEmphasisMarker, MarkdownEmphasisNode, MarkdownEntityNode, MarkdownFootnoteDefinitionNode, MarkdownFootnoteReferenceNode, MarkdownHardBreakNode, MarkdownHeadingLevel, MarkdownHeadingNode, MarkdownHeadingStyle, MarkdownHtmlBlockNode, MarkdownImageNode, MarkdownInlineNode, MarkdownLinkNode, MarkdownListItemNode, MarkdownListMarkerType, MarkdownListNode, MarkdownMathBlockNode, MarkdownMathInlineNode, MarkdownNode, MarkdownOrderedListDelimiter, MarkdownParagraphNode, MarkdownPosition, MarkdownRawHtmlNode, MarkdownSoftBreakNode, MarkdownStrikethroughNode, MarkdownStrongNode, MarkdownTableAlignment, MarkdownTableCellNode, MarkdownTableNode, MarkdownTableRowNode, MarkdownTextNode, MarkdownThematicBreakNode, isMarkdownBlockNode, isMarkdownInlineNode };
package/dist/ast/ast.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as MarkdownSoftBreakNode, B as isMarkdownInlineNode, C as MarkdownMathBlockNode, D as MarkdownParagraphNode, E as MarkdownOrderedListDelimiter, F as MarkdownTableNode, I as MarkdownTableRowNode, L as MarkdownTextNode, M as MarkdownStrongNode, N as MarkdownTableAlignment, O as MarkdownPosition, P as MarkdownTableCellNode, R as MarkdownThematicBreakNode, S as MarkdownListNode, T as MarkdownNode, _ as MarkdownImageNode, a as MarkdownCodeBlockNode, b as MarkdownListItemNode, c as MarkdownEmphasisMarker, d as MarkdownFootnoteDefinitionNode, f as MarkdownFootnoteReferenceNode, g as MarkdownHtmlBlockNode, h as MarkdownHeadingStyle, i as MarkdownBulletMarker, j as MarkdownStrikethroughNode, k as MarkdownRawHtmlNode, l as MarkdownEmphasisNode, m as MarkdownHeadingNode, n as MarkdownBlockNode, o as MarkdownCodeSpanNode, p as MarkdownHardBreakNode, r as MarkdownBlockquoteNode, s as MarkdownDocumentNode, t as MarkdownAutolinkNode, u as MarkdownEntityNode, v as MarkdownInlineNode, w as MarkdownMathInlineNode, x as MarkdownListMarkerType, y as MarkdownLinkNode, z as isMarkdownBlockNode } from "../ast-CNfTgS0N.js";
2
- export { MarkdownAutolinkNode, MarkdownBlockNode, MarkdownBlockquoteNode, MarkdownBulletMarker, MarkdownCodeBlockNode, MarkdownCodeSpanNode, MarkdownDocumentNode, MarkdownEmphasisMarker, MarkdownEmphasisNode, MarkdownEntityNode, MarkdownFootnoteDefinitionNode, MarkdownFootnoteReferenceNode, MarkdownHardBreakNode, MarkdownHeadingNode, MarkdownHeadingStyle, MarkdownHtmlBlockNode, MarkdownImageNode, MarkdownInlineNode, MarkdownLinkNode, MarkdownListItemNode, MarkdownListMarkerType, MarkdownListNode, MarkdownMathBlockNode, MarkdownMathInlineNode, MarkdownNode, MarkdownOrderedListDelimiter, MarkdownParagraphNode, MarkdownPosition, MarkdownRawHtmlNode, MarkdownSoftBreakNode, MarkdownStrikethroughNode, MarkdownStrongNode, MarkdownTableAlignment, MarkdownTableCellNode, MarkdownTableNode, MarkdownTableRowNode, MarkdownTextNode, MarkdownThematicBreakNode, isMarkdownBlockNode, isMarkdownInlineNode };
1
+ import { A as MarkdownRawHtmlNode, B as isMarkdownBlockNode, C as MarkdownListNode, D as MarkdownOrderedListDelimiter, E as MarkdownNode, F as MarkdownTableCellNode, I as MarkdownTableNode, L as MarkdownTableRowNode, M as MarkdownStrikethroughNode, N as MarkdownStrongNode, O as MarkdownParagraphNode, P as MarkdownTableAlignment, R as MarkdownTextNode, S as MarkdownListMarkerType, T as MarkdownMathInlineNode, V as isMarkdownInlineNode, _ as MarkdownHtmlBlockNode, a as MarkdownCodeBlockNode, b as MarkdownLinkNode, c as MarkdownEmphasisMarker, d as MarkdownFootnoteDefinitionNode, f as MarkdownFootnoteReferenceNode, g as MarkdownHeadingStyle, h as MarkdownHeadingNode, i as MarkdownBulletMarker, j as MarkdownSoftBreakNode, k as MarkdownPosition, l as MarkdownEmphasisNode, m as MarkdownHeadingLevel, n as MarkdownBlockNode, o as MarkdownCodeSpanNode, p as MarkdownHardBreakNode, r as MarkdownBlockquoteNode, s as MarkdownDocumentNode, t as MarkdownAutolinkNode, u as MarkdownEntityNode, v as MarkdownImageNode, w as MarkdownMathBlockNode, x as MarkdownListItemNode, y as MarkdownInlineNode, z as MarkdownThematicBreakNode } from "../ast-DI-t9uKv.js";
2
+ export { MarkdownAutolinkNode, MarkdownBlockNode, MarkdownBlockquoteNode, MarkdownBulletMarker, MarkdownCodeBlockNode, MarkdownCodeSpanNode, MarkdownDocumentNode, MarkdownEmphasisMarker, MarkdownEmphasisNode, MarkdownEntityNode, MarkdownFootnoteDefinitionNode, MarkdownFootnoteReferenceNode, MarkdownHardBreakNode, MarkdownHeadingLevel, MarkdownHeadingNode, MarkdownHeadingStyle, MarkdownHtmlBlockNode, MarkdownImageNode, MarkdownInlineNode, MarkdownLinkNode, MarkdownListItemNode, MarkdownListMarkerType, MarkdownListNode, MarkdownMathBlockNode, MarkdownMathInlineNode, MarkdownNode, MarkdownOrderedListDelimiter, MarkdownParagraphNode, MarkdownPosition, MarkdownRawHtmlNode, MarkdownSoftBreakNode, MarkdownStrikethroughNode, MarkdownStrongNode, MarkdownTableAlignment, MarkdownTableCellNode, MarkdownTableNode, MarkdownTableRowNode, MarkdownTextNode, MarkdownThematicBreakNode, isMarkdownBlockNode, isMarkdownInlineNode };
@@ -18,9 +18,10 @@ interface MarkdownParagraphNode {
18
18
  readonly position?: MarkdownPosition;
19
19
  }
20
20
  type MarkdownHeadingStyle = "atx" | "setext";
21
+ type MarkdownHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
21
22
  interface MarkdownHeadingNode {
22
23
  readonly type: "heading";
23
- readonly level: 1 | 2 | 3 | 4 | 5 | 6;
24
+ readonly level: MarkdownHeadingLevel;
24
25
  readonly style: MarkdownHeadingStyle;
25
26
  readonly children: MarkdownInlineNode[];
26
27
  readonly position?: MarkdownPosition;
@@ -178,4 +179,4 @@ interface MarkdownFootnoteReferenceNode {
178
179
  declare function isMarkdownBlockNode(node: MarkdownNode): node is MarkdownBlockNode;
179
180
  declare function isMarkdownInlineNode(node: MarkdownNode): node is MarkdownInlineNode;
180
181
  //#endregion
181
- export { MarkdownSoftBreakNode as A, isMarkdownInlineNode as B, MarkdownMathBlockNode as C, MarkdownParagraphNode as D, MarkdownOrderedListDelimiter as E, MarkdownTableNode as F, MarkdownTableRowNode as I, MarkdownTextNode as L, MarkdownStrongNode as M, MarkdownTableAlignment as N, MarkdownPosition as O, MarkdownTableCellNode as P, MarkdownThematicBreakNode as R, MarkdownListNode as S, MarkdownNode as T, MarkdownImageNode as _, MarkdownCodeBlockNode as a, MarkdownListItemNode as b, MarkdownEmphasisMarker as c, MarkdownFootnoteDefinitionNode as d, MarkdownFootnoteReferenceNode as f, MarkdownHtmlBlockNode as g, MarkdownHeadingStyle as h, MarkdownBulletMarker as i, MarkdownStrikethroughNode as j, MarkdownRawHtmlNode as k, MarkdownEmphasisNode as l, MarkdownHeadingNode as m, MarkdownBlockNode as n, MarkdownCodeSpanNode as o, MarkdownHardBreakNode as p, MarkdownBlockquoteNode as r, MarkdownDocumentNode as s, MarkdownAutolinkNode as t, MarkdownEntityNode as u, MarkdownInlineNode as v, MarkdownMathInlineNode as w, MarkdownListMarkerType as x, MarkdownLinkNode as y, isMarkdownBlockNode as z };
182
+ export { MarkdownRawHtmlNode as A, isMarkdownBlockNode as B, MarkdownListNode as C, MarkdownOrderedListDelimiter as D, MarkdownNode as E, MarkdownTableCellNode as F, MarkdownTableNode as I, MarkdownTableRowNode as L, MarkdownStrikethroughNode as M, MarkdownStrongNode as N, MarkdownParagraphNode as O, MarkdownTableAlignment as P, MarkdownTextNode as R, MarkdownListMarkerType as S, MarkdownMathInlineNode as T, isMarkdownInlineNode as V, MarkdownHtmlBlockNode as _, MarkdownCodeBlockNode as a, MarkdownLinkNode as b, MarkdownEmphasisMarker as c, MarkdownFootnoteDefinitionNode as d, MarkdownFootnoteReferenceNode as f, MarkdownHeadingStyle as g, MarkdownHeadingNode as h, MarkdownBulletMarker as i, MarkdownSoftBreakNode as j, MarkdownPosition as k, MarkdownEmphasisNode as l, MarkdownHeadingLevel as m, MarkdownBlockNode as n, MarkdownCodeSpanNode as o, MarkdownHardBreakNode as p, MarkdownBlockquoteNode as r, MarkdownDocumentNode as s, MarkdownAutolinkNode as t, MarkdownEntityNode as u, MarkdownImageNode as v, MarkdownMathBlockNode as w, MarkdownListItemNode as x, MarkdownInlineNode as y, MarkdownThematicBreakNode as z };
@@ -18,9 +18,10 @@ interface MarkdownParagraphNode {
18
18
  readonly position?: MarkdownPosition;
19
19
  }
20
20
  type MarkdownHeadingStyle = "atx" | "setext";
21
+ type MarkdownHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
21
22
  interface MarkdownHeadingNode {
22
23
  readonly type: "heading";
23
- readonly level: 1 | 2 | 3 | 4 | 5 | 6;
24
+ readonly level: MarkdownHeadingLevel;
24
25
  readonly style: MarkdownHeadingStyle;
25
26
  readonly children: MarkdownInlineNode[];
26
27
  readonly position?: MarkdownPosition;
@@ -178,4 +179,4 @@ interface MarkdownFootnoteReferenceNode {
178
179
  declare function isMarkdownBlockNode(node: MarkdownNode): node is MarkdownBlockNode;
179
180
  declare function isMarkdownInlineNode(node: MarkdownNode): node is MarkdownInlineNode;
180
181
  //#endregion
181
- export { MarkdownSoftBreakNode as A, isMarkdownInlineNode as B, MarkdownMathBlockNode as C, MarkdownParagraphNode as D, MarkdownOrderedListDelimiter as E, MarkdownTableNode as F, MarkdownTableRowNode as I, MarkdownTextNode as L, MarkdownStrongNode as M, MarkdownTableAlignment as N, MarkdownPosition as O, MarkdownTableCellNode as P, MarkdownThematicBreakNode as R, MarkdownListNode as S, MarkdownNode as T, MarkdownImageNode as _, MarkdownCodeBlockNode as a, MarkdownListItemNode as b, MarkdownEmphasisMarker as c, MarkdownFootnoteDefinitionNode as d, MarkdownFootnoteReferenceNode as f, MarkdownHtmlBlockNode as g, MarkdownHeadingStyle as h, MarkdownBulletMarker as i, MarkdownStrikethroughNode as j, MarkdownRawHtmlNode as k, MarkdownEmphasisNode as l, MarkdownHeadingNode as m, MarkdownBlockNode as n, MarkdownCodeSpanNode as o, MarkdownHardBreakNode as p, MarkdownBlockquoteNode as r, MarkdownDocumentNode as s, MarkdownAutolinkNode as t, MarkdownEntityNode as u, MarkdownInlineNode as v, MarkdownMathInlineNode as w, MarkdownListMarkerType as x, MarkdownLinkNode as y, isMarkdownBlockNode as z };
182
+ export { MarkdownRawHtmlNode as A, isMarkdownBlockNode as B, MarkdownListNode as C, MarkdownOrderedListDelimiter as D, MarkdownNode as E, MarkdownTableCellNode as F, MarkdownTableNode as I, MarkdownTableRowNode as L, MarkdownStrikethroughNode as M, MarkdownStrongNode as N, MarkdownParagraphNode as O, MarkdownTableAlignment as P, MarkdownTextNode as R, MarkdownListMarkerType as S, MarkdownMathInlineNode as T, isMarkdownInlineNode as V, MarkdownHtmlBlockNode as _, MarkdownCodeBlockNode as a, MarkdownLinkNode as b, MarkdownEmphasisMarker as c, MarkdownFootnoteDefinitionNode as d, MarkdownFootnoteReferenceNode as f, MarkdownHeadingStyle as g, MarkdownHeadingNode as h, MarkdownBulletMarker as i, MarkdownSoftBreakNode as j, MarkdownPosition as k, MarkdownEmphasisNode as l, MarkdownHeadingLevel as m, MarkdownBlockNode as n, MarkdownCodeSpanNode as o, MarkdownHardBreakNode as p, MarkdownBlockquoteNode as r, MarkdownDocumentNode as s, MarkdownAutolinkNode as t, MarkdownEntityNode as u, MarkdownImageNode as v, MarkdownMathBlockNode as w, MarkdownListItemNode as x, MarkdownInlineNode as y, MarkdownThematicBreakNode as z };
@@ -35,14 +35,8 @@ function isBlankContent(content) {
35
35
  return BLANK_CONTENT_PATTERN.test(content);
36
36
  }
37
37
  function headingLevelOf(hashes) {
38
- switch (hashes) {
39
- case 1: return 1;
40
- case 2: return 2;
41
- case 3: return 3;
42
- case 4: return 4;
43
- case 5: return 5;
44
- default: return MAX_HEADING_LEVEL;
45
- }
38
+ if (hashes >= 1 && hashes < MAX_HEADING_LEVEL) return hashes;
39
+ return MAX_HEADING_LEVEL;
46
40
  }
47
41
  var BlockParser = class {
48
42
  references = /* @__PURE__ */ new Map();
@@ -338,9 +332,10 @@ var BlockParser = class {
338
332
  const alignments = require_block_table.parseTableDelimiterRow(this.line.restFromNextNonspace());
339
333
  if (alignments === void 0) return "none";
340
334
  const lines = paragraph.content.split("\n");
341
- const headerLine = lines.at(-2);
335
+ const secondToLastLineOffset = -2;
336
+ const headerLine = lines.at(secondToLastLineOffset);
342
337
  if (headerLine === void 0 || require_block_table.splitTableRow(headerLine).length !== alignments.length) return "none";
343
- paragraph.content = lines.slice(0, -2).map((text) => `${text}\n`).join("");
338
+ paragraph.content = lines.slice(0, secondToLastLineOffset).map((text) => `${text}\n`).join("");
344
339
  const table = this.addChild("table");
345
340
  table.alignments = alignments;
346
341
  table.headerLine = headerLine;
@@ -1,8 +1,8 @@
1
- import { s as MarkdownDocumentNode } from "../ast-CNfTgS0N.cjs";
1
+ import { s as MarkdownDocumentNode } from "../ast-DI-t9uKv.cjs";
2
2
  import { r as FootnoteLabelSet } from "../footnote-CKk4JbLk.cjs";
3
3
  import { i as MarkdownDiagnosticSink } from "../diagnostics-D3UiC9HL.cjs";
4
4
  import { LinkReferenceMap } from "../inline/link.cjs";
5
- import { t as InlineParseOptions } from "../inline-B8WNyxnI.cjs";
5
+ import { t as InlineParseOptions } from "../inline-GzD5QtFh.cjs";
6
6
  //#region src/block/block.d.ts
7
7
  declare const ATX_MARKER_PATTERN: RegExp;
8
8
  declare const CODE_FENCE_PATTERN: RegExp;
@@ -1,8 +1,8 @@
1
- import { s as MarkdownDocumentNode } from "../ast-CNfTgS0N.js";
1
+ import { s as MarkdownDocumentNode } from "../ast-DI-t9uKv.js";
2
2
  import { r as FootnoteLabelSet } from "../footnote-CKk4JbLk.js";
3
3
  import { i as MarkdownDiagnosticSink } from "../diagnostics-D3UiC9HL.js";
4
4
  import { LinkReferenceMap } from "../inline/link.js";
5
- import { t as InlineParseOptions } from "../inline-BBtsaDjb.js";
5
+ import { t as InlineParseOptions } from "../inline-CArcArOD.js";
6
6
  //#region src/block/block.d.ts
7
7
  declare const ATX_MARKER_PATTERN: RegExp;
8
8
  declare const CODE_FENCE_PATTERN: RegExp;
@@ -34,14 +34,8 @@ function isBlankContent(content) {
34
34
  return BLANK_CONTENT_PATTERN.test(content);
35
35
  }
36
36
  function headingLevelOf(hashes) {
37
- switch (hashes) {
38
- case 1: return 1;
39
- case 2: return 2;
40
- case 3: return 3;
41
- case 4: return 4;
42
- case 5: return 5;
43
- default: return MAX_HEADING_LEVEL;
44
- }
37
+ if (hashes >= 1 && hashes < MAX_HEADING_LEVEL) return hashes;
38
+ return MAX_HEADING_LEVEL;
45
39
  }
46
40
  var BlockParser = class {
47
41
  references = /* @__PURE__ */ new Map();
@@ -337,9 +331,10 @@ var BlockParser = class {
337
331
  const alignments = parseTableDelimiterRow(this.line.restFromNextNonspace());
338
332
  if (alignments === void 0) return "none";
339
333
  const lines = paragraph.content.split("\n");
340
- const headerLine = lines.at(-2);
334
+ const secondToLastLineOffset = -2;
335
+ const headerLine = lines.at(secondToLastLineOffset);
341
336
  if (headerLine === void 0 || splitTableRow(headerLine).length !== alignments.length) return "none";
342
- paragraph.content = lines.slice(0, -2).map((text) => `${text}\n`).join("");
337
+ paragraph.content = lines.slice(0, secondToLastLineOffset).map((text) => `${text}\n`).join("");
343
338
  const table = this.addChild("table");
344
339
  table.alignments = alignments;
345
340
  table.headerLine = headerLine;
@@ -1,4 +1,4 @@
1
- import { E as MarkdownOrderedListDelimiter, N as MarkdownTableAlignment, i as MarkdownBulletMarker } from "../ast-CNfTgS0N.cjs";
1
+ import { D as MarkdownOrderedListDelimiter, P as MarkdownTableAlignment, i as MarkdownBulletMarker } from "../ast-DI-t9uKv.cjs";
2
2
  import { t as HtmlBlockType } from "../html-bkz2QTuq.cjs";
3
3
  //#region src/block/node.d.ts
4
4
  type BlockNodeKind = "document" | "paragraph" | "heading" | "blockquote" | "list" | "listItem" | "codeBlock" | "htmlBlock" | "thematicBreak" | "table" | "mathBlock" | "footnoteDefinition";
@@ -1,4 +1,4 @@
1
- import { E as MarkdownOrderedListDelimiter, N as MarkdownTableAlignment, i as MarkdownBulletMarker } from "../ast-CNfTgS0N.js";
1
+ import { D as MarkdownOrderedListDelimiter, P as MarkdownTableAlignment, i as MarkdownBulletMarker } from "../ast-DI-t9uKv.js";
2
2
  import { t as HtmlBlockType } from "../html-bkz2QTuq.js";
3
3
  //#region src/block/node.d.ts
4
4
  type BlockNodeKind = "document" | "paragraph" | "heading" | "blockquote" | "list" | "listItem" | "codeBlock" | "htmlBlock" | "thematicBreak" | "table" | "mathBlock" | "footnoteDefinition";
@@ -1,4 +1,4 @@
1
- import { N as MarkdownTableAlignment } from "../ast-CNfTgS0N.cjs";
1
+ import { P as MarkdownTableAlignment } from "../ast-DI-t9uKv.cjs";
2
2
  //#region src/block/table.d.ts
3
3
  declare function splitTableRow(line: string): string[];
4
4
  declare function parseTableDelimiterRow(line: string): MarkdownTableAlignment[] | undefined;
@@ -1,4 +1,4 @@
1
- import { N as MarkdownTableAlignment } from "../ast-CNfTgS0N.js";
1
+ import { P as MarkdownTableAlignment } from "../ast-DI-t9uKv.js";
2
2
  //#region src/block/table.d.ts
3
3
  declare function splitTableRow(line: string): string[];
4
4
  declare function parseTableDelimiterRow(line: string): MarkdownTableAlignment[] | undefined;
@@ -37,6 +37,7 @@ function renderAtxHeading(level, text) {
37
37
  return `${"#".repeat(level)} ${collapsed}`;
38
38
  }
39
39
  const MIN_CODE_FENCE_LENGTH = 3;
40
+ const THEMATIC_BREAK_CHAR_COUNT = 3;
40
41
  function longestRunLength(text, char) {
41
42
  let longest = 0;
42
43
  let current = 0;
@@ -139,7 +140,7 @@ function quoteDepthOf(paragraph) {
139
140
  return Math.max(1, Math.round(paragraph.indentLeftPt / 36));
140
141
  }
141
142
  function renderParagraphBody(paragraph, context) {
142
- if (paragraph.styleId === "HorizontalRule") return context.thematicBreakChar.repeat(3);
143
+ if (paragraph.styleId === "HorizontalRule") return context.thematicBreakChar.repeat(THEMATIC_BREAK_CHAR_COUNT);
143
144
  if (paragraph.styleId === "CodeBlock") {
144
145
  const literal = paragraph.runs.map((run) => run.text).join("");
145
146
  const fence = codeFenceFor(literal, context.codeFenceChar);
package/dist/emit/emit.js CHANGED
@@ -36,6 +36,7 @@ function renderAtxHeading(level, text) {
36
36
  return `${"#".repeat(level)} ${collapsed}`;
37
37
  }
38
38
  const MIN_CODE_FENCE_LENGTH = 3;
39
+ const THEMATIC_BREAK_CHAR_COUNT = 3;
39
40
  function longestRunLength(text, char) {
40
41
  let longest = 0;
41
42
  let current = 0;
@@ -138,7 +139,7 @@ function quoteDepthOf(paragraph) {
138
139
  return Math.max(1, Math.round(paragraph.indentLeftPt / 36));
139
140
  }
140
141
  function renderParagraphBody(paragraph, context) {
141
- if (paragraph.styleId === "HorizontalRule") return context.thematicBreakChar.repeat(3);
142
+ if (paragraph.styleId === "HorizontalRule") return context.thematicBreakChar.repeat(THEMATIC_BREAK_CHAR_COUNT);
142
143
  if (paragraph.styleId === "CodeBlock") {
143
144
  const literal = paragraph.runs.map((run) => run.text).join("");
144
145
  const fence = codeFenceFor(literal, context.codeFenceChar);
@@ -58,12 +58,13 @@ function readPositiveIntAttr(attrs, name) {
58
58
  return Number.isFinite(value) && value > 0 ? value : void 0;
59
59
  }
60
60
  const BACKGROUND_COLOR_PATTERN = /background-color\s*:\s*#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})\b/i;
61
+ const SHORT_HEX_DIGIT_COUNT = 3;
61
62
  function readBackgroundFill(attrs) {
62
63
  const style = readAttr(attrs, "style");
63
64
  if (style === void 0) return;
64
65
  const hex = BACKGROUND_COLOR_PATTERN.exec(style)?.[1];
65
66
  if (hex === void 0) return;
66
- const normalised = hex.length === 3 ? hex.split("").map((digit) => digit + digit).join("") : hex;
67
+ const normalised = hex.length === SHORT_HEX_DIGIT_COUNT ? hex.split("").map((digit) => digit + digit).join("") : hex;
67
68
  return {
68
69
  kind: "solid",
69
70
  color: (0, document_schema_js.rgbHexToColor)(normalised)
@@ -57,12 +57,13 @@ function readPositiveIntAttr(attrs, name) {
57
57
  return Number.isFinite(value) && value > 0 ? value : void 0;
58
58
  }
59
59
  const BACKGROUND_COLOR_PATTERN = /background-color\s*:\s*#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})\b/i;
60
+ const SHORT_HEX_DIGIT_COUNT = 3;
60
61
  function readBackgroundFill(attrs) {
61
62
  const style = readAttr(attrs, "style");
62
63
  if (style === void 0) return;
63
64
  const hex = BACKGROUND_COLOR_PATTERN.exec(style)?.[1];
64
65
  if (hex === void 0) return;
65
- const normalised = hex.length === 3 ? hex.split("").map((digit) => digit + digit).join("") : hex;
66
+ const normalised = hex.length === SHORT_HEX_DIGIT_COUNT ? hex.split("").map((digit) => digit + digit).join("") : hex;
66
67
  return {
67
68
  kind: "solid",
68
69
  color: rgbHexToColor(normalised)
@@ -1,4 +1,4 @@
1
- import { s as MarkdownDocumentNode, v as MarkdownInlineNode } from "../ast-CNfTgS0N.cjs";
1
+ import { s as MarkdownDocumentNode, y as MarkdownInlineNode } from "../ast-DI-t9uKv.cjs";
2
2
  //#region src/html/render.d.ts
3
3
  declare function escapeHtml(text: string): string;
4
4
  declare function escapeHref(href: string): string;
@@ -1,4 +1,4 @@
1
- import { s as MarkdownDocumentNode, v as MarkdownInlineNode } from "../ast-CNfTgS0N.js";
1
+ import { s as MarkdownDocumentNode, y as MarkdownInlineNode } from "../ast-DI-t9uKv.js";
2
2
  //#region src/html/render.d.ts
3
3
  declare function escapeHtml(text: string): string;
4
4
  declare function escapeHref(href: string): string;
@@ -1,42 +1,57 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region src/image/image.ts
3
+ const BITS_PER_BYTE = 8;
4
+ const TWO_BYTE_SHIFT = 16;
5
+ const THREE_BYTE_SHIFT = 24;
6
+ const UINT16_MASK = 65535;
7
+ const UINT32_LOW_BYTE_OFFSET = 3;
3
8
  function readUint16BE(bytes, offset) {
4
- return (bytes[offset] << 8 | bytes[offset + 1]) & 65535;
9
+ return (bytes[offset] << BITS_PER_BYTE | bytes[offset + 1]) & UINT16_MASK;
5
10
  }
6
11
  function readUint32BE(bytes, offset) {
7
- return (bytes[offset] << 24 | bytes[offset + 1] << 16 | bytes[offset + 2] << 8 | bytes[offset + 3]) >>> 0;
12
+ return (bytes[offset] << THREE_BYTE_SHIFT | bytes[offset + 1] << TWO_BYTE_SHIFT | bytes[offset + 2] << BITS_PER_BYTE | bytes[offset + UINT32_LOW_BYTE_OFFSET]) >>> 0;
8
13
  }
9
- const PNG_SIGNATURE = [
10
- 137,
11
- 80,
12
- 78,
13
- 71,
14
- 13,
15
- 10,
16
- 26,
17
- 10
18
- ];
14
+ const PNG_SIGNATURE = [137, ...Array.from("PNG\r\n\n", (char) => char.charCodeAt(0))];
19
15
  const PNG_HEADER_BYTES = 24;
16
+ const IHDR_CHUNK_TYPE_OFFSET = 12;
17
+ const IHDR_TYPE_BYTES = Array.from("IHDR", (char) => char.charCodeAt(0));
18
+ const PNG_WIDTH_OFFSET = 16;
19
+ const PNG_HEIGHT_OFFSET = 20;
20
20
  function isPng(bytes) {
21
21
  return PNG_SIGNATURE.every((byte, index) => bytes[index] === byte);
22
22
  }
23
+ const JPEG_MARKER_PREFIX = 255;
24
+ const JPEG_SOI = 216;
25
+ const JPEG_EOI = 217;
26
+ const JPEG_TEM = 1;
27
+ const JPEG_RST_MIN = 208;
28
+ const JPEG_RST_MAX = 215;
29
+ const JPEG_SOS = 218;
30
+ const JPEG_SOF_MARKER_MIN = 192;
31
+ const JPEG_SOF_MARKER_MAX = 207;
32
+ const JPEG_DHT_MARKER = 196;
33
+ const JPEG_JPG_RESERVED_MARKER = 200;
34
+ const JPEG_DAC_MARKER = 204;
35
+ const JPEG_SOF_SEGMENT_MIN_LENGTH = 7;
36
+ const JPEG_SOF_HEIGHT_OFFSET = 3;
37
+ const JPEG_SOF_WIDTH_OFFSET = 5;
23
38
  function isJpeg(bytes) {
24
- return bytes[0] === 255 && bytes[1] === 216;
39
+ return bytes[0] === JPEG_MARKER_PREFIX && bytes[1] === JPEG_SOI;
25
40
  }
26
41
  function readPngDimensions(bytes) {
27
42
  if (bytes.length < PNG_HEADER_BYTES) return;
28
- if (bytes[12] !== 73 || bytes[13] !== 72 || bytes[14] !== 68 || bytes[15] !== 82) return;
43
+ if (!IHDR_TYPE_BYTES.every((byte, index) => bytes[IHDR_CHUNK_TYPE_OFFSET + index] === byte)) return;
29
44
  return {
30
- widthPx: readUint32BE(bytes, 16),
31
- heightPx: readUint32BE(bytes, 20)
45
+ widthPx: readUint32BE(bytes, PNG_WIDTH_OFFSET),
46
+ heightPx: readUint32BE(bytes, PNG_HEIGHT_OFFSET)
32
47
  };
33
48
  }
34
49
  function isStartOfFrameMarker(marker) {
35
- if (marker < 192 || marker > 207) return false;
36
- return marker !== 196 && marker !== 200 && marker !== 204;
50
+ if (marker < JPEG_SOF_MARKER_MIN || marker > JPEG_SOF_MARKER_MAX) return false;
51
+ return marker !== JPEG_DHT_MARKER && marker !== JPEG_JPG_RESERVED_MARKER && marker !== JPEG_DAC_MARKER;
37
52
  }
38
53
  function hasNoLengthField(marker) {
39
- return marker === 216 || marker === 217 || marker === 1 || marker >= 208 && marker <= 215;
54
+ return marker === JPEG_SOI || marker === JPEG_EOI || marker === JPEG_TEM || marker >= JPEG_RST_MIN && marker <= JPEG_RST_MAX;
40
55
  }
41
56
  function readJpegDimensions(bytes) {
42
57
  if (!isJpeg(bytes)) return;
@@ -44,26 +59,26 @@ function readJpegDimensions(bytes) {
44
59
  for (;;) {
45
60
  const byte = bytes[offset];
46
61
  if (byte === void 0) return;
47
- if (byte !== 255) {
62
+ if (byte !== JPEG_MARKER_PREFIX) {
48
63
  offset += 1;
49
64
  continue;
50
65
  }
51
66
  let markerOffset = offset + 1;
52
- while (bytes[markerOffset] === 255) markerOffset += 1;
67
+ while (bytes[markerOffset] === JPEG_MARKER_PREFIX) markerOffset += 1;
53
68
  const marker = bytes[markerOffset];
54
69
  if (marker === void 0) return;
55
70
  offset = markerOffset + 1;
56
71
  if (hasNoLengthField(marker)) continue;
57
72
  const length = readUint16BE(bytes, offset);
58
73
  if (isStartOfFrameMarker(marker)) {
59
- if (offset + 7 > bytes.length) return;
60
- const heightPx = readUint16BE(bytes, offset + 3);
74
+ if (offset + JPEG_SOF_SEGMENT_MIN_LENGTH > bytes.length) return;
75
+ const heightPx = readUint16BE(bytes, offset + JPEG_SOF_HEIGHT_OFFSET);
61
76
  return {
62
- widthPx: readUint16BE(bytes, offset + 5),
77
+ widthPx: readUint16BE(bytes, offset + JPEG_SOF_WIDTH_OFFSET),
63
78
  heightPx
64
79
  };
65
80
  }
66
- if (marker === 218) return;
81
+ if (marker === JPEG_SOS) return;
67
82
  offset += length;
68
83
  }
69
84
  }
@@ -1,41 +1,56 @@
1
1
  //#region src/image/image.ts
2
+ const BITS_PER_BYTE = 8;
3
+ const TWO_BYTE_SHIFT = 16;
4
+ const THREE_BYTE_SHIFT = 24;
5
+ const UINT16_MASK = 65535;
6
+ const UINT32_LOW_BYTE_OFFSET = 3;
2
7
  function readUint16BE(bytes, offset) {
3
- return (bytes[offset] << 8 | bytes[offset + 1]) & 65535;
8
+ return (bytes[offset] << BITS_PER_BYTE | bytes[offset + 1]) & UINT16_MASK;
4
9
  }
5
10
  function readUint32BE(bytes, offset) {
6
- return (bytes[offset] << 24 | bytes[offset + 1] << 16 | bytes[offset + 2] << 8 | bytes[offset + 3]) >>> 0;
11
+ return (bytes[offset] << THREE_BYTE_SHIFT | bytes[offset + 1] << TWO_BYTE_SHIFT | bytes[offset + 2] << BITS_PER_BYTE | bytes[offset + UINT32_LOW_BYTE_OFFSET]) >>> 0;
7
12
  }
8
- const PNG_SIGNATURE = [
9
- 137,
10
- 80,
11
- 78,
12
- 71,
13
- 13,
14
- 10,
15
- 26,
16
- 10
17
- ];
13
+ const PNG_SIGNATURE = [137, ...Array.from("PNG\r\n\n", (char) => char.charCodeAt(0))];
18
14
  const PNG_HEADER_BYTES = 24;
15
+ const IHDR_CHUNK_TYPE_OFFSET = 12;
16
+ const IHDR_TYPE_BYTES = Array.from("IHDR", (char) => char.charCodeAt(0));
17
+ const PNG_WIDTH_OFFSET = 16;
18
+ const PNG_HEIGHT_OFFSET = 20;
19
19
  function isPng(bytes) {
20
20
  return PNG_SIGNATURE.every((byte, index) => bytes[index] === byte);
21
21
  }
22
+ const JPEG_MARKER_PREFIX = 255;
23
+ const JPEG_SOI = 216;
24
+ const JPEG_EOI = 217;
25
+ const JPEG_TEM = 1;
26
+ const JPEG_RST_MIN = 208;
27
+ const JPEG_RST_MAX = 215;
28
+ const JPEG_SOS = 218;
29
+ const JPEG_SOF_MARKER_MIN = 192;
30
+ const JPEG_SOF_MARKER_MAX = 207;
31
+ const JPEG_DHT_MARKER = 196;
32
+ const JPEG_JPG_RESERVED_MARKER = 200;
33
+ const JPEG_DAC_MARKER = 204;
34
+ const JPEG_SOF_SEGMENT_MIN_LENGTH = 7;
35
+ const JPEG_SOF_HEIGHT_OFFSET = 3;
36
+ const JPEG_SOF_WIDTH_OFFSET = 5;
22
37
  function isJpeg(bytes) {
23
- return bytes[0] === 255 && bytes[1] === 216;
38
+ return bytes[0] === JPEG_MARKER_PREFIX && bytes[1] === JPEG_SOI;
24
39
  }
25
40
  function readPngDimensions(bytes) {
26
41
  if (bytes.length < PNG_HEADER_BYTES) return;
27
- if (bytes[12] !== 73 || bytes[13] !== 72 || bytes[14] !== 68 || bytes[15] !== 82) return;
42
+ if (!IHDR_TYPE_BYTES.every((byte, index) => bytes[IHDR_CHUNK_TYPE_OFFSET + index] === byte)) return;
28
43
  return {
29
- widthPx: readUint32BE(bytes, 16),
30
- heightPx: readUint32BE(bytes, 20)
44
+ widthPx: readUint32BE(bytes, PNG_WIDTH_OFFSET),
45
+ heightPx: readUint32BE(bytes, PNG_HEIGHT_OFFSET)
31
46
  };
32
47
  }
33
48
  function isStartOfFrameMarker(marker) {
34
- if (marker < 192 || marker > 207) return false;
35
- return marker !== 196 && marker !== 200 && marker !== 204;
49
+ if (marker < JPEG_SOF_MARKER_MIN || marker > JPEG_SOF_MARKER_MAX) return false;
50
+ return marker !== JPEG_DHT_MARKER && marker !== JPEG_JPG_RESERVED_MARKER && marker !== JPEG_DAC_MARKER;
36
51
  }
37
52
  function hasNoLengthField(marker) {
38
- return marker === 216 || marker === 217 || marker === 1 || marker >= 208 && marker <= 215;
53
+ return marker === JPEG_SOI || marker === JPEG_EOI || marker === JPEG_TEM || marker >= JPEG_RST_MIN && marker <= JPEG_RST_MAX;
39
54
  }
40
55
  function readJpegDimensions(bytes) {
41
56
  if (!isJpeg(bytes)) return;
@@ -43,26 +58,26 @@ function readJpegDimensions(bytes) {
43
58
  for (;;) {
44
59
  const byte = bytes[offset];
45
60
  if (byte === void 0) return;
46
- if (byte !== 255) {
61
+ if (byte !== JPEG_MARKER_PREFIX) {
47
62
  offset += 1;
48
63
  continue;
49
64
  }
50
65
  let markerOffset = offset + 1;
51
- while (bytes[markerOffset] === 255) markerOffset += 1;
66
+ while (bytes[markerOffset] === JPEG_MARKER_PREFIX) markerOffset += 1;
52
67
  const marker = bytes[markerOffset];
53
68
  if (marker === void 0) return;
54
69
  offset = markerOffset + 1;
55
70
  if (hasNoLengthField(marker)) continue;
56
71
  const length = readUint16BE(bytes, offset);
57
72
  if (isStartOfFrameMarker(marker)) {
58
- if (offset + 7 > bytes.length) return;
59
- const heightPx = readUint16BE(bytes, offset + 3);
73
+ if (offset + JPEG_SOF_SEGMENT_MIN_LENGTH > bytes.length) return;
74
+ const heightPx = readUint16BE(bytes, offset + JPEG_SOF_HEIGHT_OFFSET);
60
75
  return {
61
- widthPx: readUint16BE(bytes, offset + 5),
76
+ widthPx: readUint16BE(bytes, offset + JPEG_SOF_WIDTH_OFFSET),
62
77
  heightPx
63
78
  };
64
79
  }
65
- if (marker === 218) return;
80
+ if (marker === JPEG_SOS) return;
66
81
  offset += length;
67
82
  }
68
83
  }
@@ -12,10 +12,12 @@ const UNICODE_PUNCTUATION_PATTERN = /^[\p{P}\p{S}]$/u;
12
12
  function isUnicodePunctuation(char) {
13
13
  return UNICODE_PUNCTUATION_PATTERN.test(char);
14
14
  }
15
+ const ASCII_CONTROL_MAX = 31;
16
+ const ASCII_DELETE = 127;
15
17
  function isAsciiControl(char) {
16
18
  const code = char.codePointAt(0);
17
19
  if (code === void 0) return false;
18
- return code <= 31 || code === 127;
20
+ return code <= ASCII_CONTROL_MAX || code === ASCII_DELETE;
19
21
  }
20
22
  function containsAsciiControlOrSpace(text) {
21
23
  return text.split("").some((char) => isAsciiControl(char) || char === " ");
@@ -23,12 +25,16 @@ function containsAsciiControlOrSpace(text) {
23
25
  function isMarkdownSpace(char) {
24
26
  return char === " " || char === " " || char === "\n" || char === "\r";
25
27
  }
28
+ const LOW_SURROGATE_START = 56320;
29
+ const LOW_SURROGATE_END = 57343;
30
+ const HIGH_SURROGATE_START = 55296;
31
+ const HIGH_SURROGATE_END = 56319;
26
32
  function codePointBefore(text, index) {
27
33
  if (index <= 0) return "\n";
28
34
  const low = text.charCodeAt(index - 1);
29
- if (low >= 56320 && low <= 57343) {
35
+ if (low >= LOW_SURROGATE_START && low <= LOW_SURROGATE_END) {
30
36
  const high = text.charCodeAt(index - 2);
31
- if (high >= 55296 && high <= 56319) return text.slice(index - 2, index);
37
+ if (high >= HIGH_SURROGATE_START && high <= HIGH_SURROGATE_END) return text.slice(index - 2, index);
32
38
  }
33
39
  return text.slice(index - 1, index);
34
40
  }
@@ -11,10 +11,12 @@ const UNICODE_PUNCTUATION_PATTERN = /^[\p{P}\p{S}]$/u;
11
11
  function isUnicodePunctuation(char) {
12
12
  return UNICODE_PUNCTUATION_PATTERN.test(char);
13
13
  }
14
+ const ASCII_CONTROL_MAX = 31;
15
+ const ASCII_DELETE = 127;
14
16
  function isAsciiControl(char) {
15
17
  const code = char.codePointAt(0);
16
18
  if (code === void 0) return false;
17
- return code <= 31 || code === 127;
19
+ return code <= ASCII_CONTROL_MAX || code === ASCII_DELETE;
18
20
  }
19
21
  function containsAsciiControlOrSpace(text) {
20
22
  return text.split("").some((char) => isAsciiControl(char) || char === " ");
@@ -22,12 +24,16 @@ function containsAsciiControlOrSpace(text) {
22
24
  function isMarkdownSpace(char) {
23
25
  return char === " " || char === " " || char === "\n" || char === "\r";
24
26
  }
27
+ const LOW_SURROGATE_START = 56320;
28
+ const LOW_SURROGATE_END = 57343;
29
+ const HIGH_SURROGATE_START = 55296;
30
+ const HIGH_SURROGATE_END = 56319;
25
31
  function codePointBefore(text, index) {
26
32
  if (index <= 0) return "\n";
27
33
  const low = text.charCodeAt(index - 1);
28
- if (low >= 56320 && low <= 57343) {
34
+ if (low >= LOW_SURROGATE_START && low <= LOW_SURROGATE_END) {
29
35
  const high = text.charCodeAt(index - 2);
30
- if (high >= 55296 && high <= 56319) return text.slice(index - 2, index);
36
+ if (high >= HIGH_SURROGATE_START && high <= HIGH_SURROGATE_END) return text.slice(index - 2, index);
31
37
  }
32
38
  return text.slice(index - 1, index);
33
39
  }
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_inline_chars = require("./chars.cjs");
3
3
  //#region src/inline/delimiter.ts
4
4
  const MAX_STRIKETHROUGH_RUN = 2;
5
+ const RULE_OF_THREE_MODULUS = 3;
5
6
  function scanDelimiterRun(text, start, char) {
6
7
  let count = 0;
7
8
  while (text.charAt(start + count) === char) count += 1;
@@ -49,10 +50,10 @@ var DelimiterStack = class {
49
50
  }
50
51
  };
51
52
  function closerSignature(closer) {
52
- return `${closer.char}${closer.canOpen ? "1" : "0"}${String(closer.origCount % 3)}`;
53
+ return `${closer.char}${closer.canOpen ? "1" : "0"}${String(closer.origCount % RULE_OF_THREE_MODULUS)}`;
53
54
  }
54
55
  function isRuleOfThreeBlocked(opener, closer) {
55
- return (closer.canOpen || opener.canClose) && closer.origCount % 3 !== 0 && (opener.origCount + closer.origCount) % 3 === 0;
56
+ return (closer.canOpen || opener.canClose) && closer.origCount % RULE_OF_THREE_MODULUS !== 0 && (opener.origCount + closer.origCount) % RULE_OF_THREE_MODULUS === 0;
56
57
  }
57
58
  function canMatch(opener, closer) {
58
59
  if (opener.char !== closer.char || !opener.canOpen) return false;
@@ -1,6 +1,7 @@
1
1
  import { codePointAt, codePointBefore, isUnicodePunctuation, isUnicodeWhitespace } from "./chars.js";
2
2
  //#region src/inline/delimiter.ts
3
3
  const MAX_STRIKETHROUGH_RUN = 2;
4
+ const RULE_OF_THREE_MODULUS = 3;
4
5
  function scanDelimiterRun(text, start, char) {
5
6
  let count = 0;
6
7
  while (text.charAt(start + count) === char) count += 1;
@@ -48,10 +49,10 @@ var DelimiterStack = class {
48
49
  }
49
50
  };
50
51
  function closerSignature(closer) {
51
- return `${closer.char}${closer.canOpen ? "1" : "0"}${String(closer.origCount % 3)}`;
52
+ return `${closer.char}${closer.canOpen ? "1" : "0"}${String(closer.origCount % RULE_OF_THREE_MODULUS)}`;
52
53
  }
53
54
  function isRuleOfThreeBlocked(opener, closer) {
54
- return (closer.canOpen || opener.canClose) && closer.origCount % 3 !== 0 && (opener.origCount + closer.origCount) % 3 === 0;
55
+ return (closer.canOpen || opener.canClose) && closer.origCount % RULE_OF_THREE_MODULUS !== 0 && (opener.origCount + closer.origCount) % RULE_OF_THREE_MODULUS === 0;
55
56
  }
56
57
  function canMatch(opener, closer) {
57
58
  if (opener.char !== closer.char || !opener.canOpen) return false;
@@ -1,2 +1,2 @@
1
- import { n as assertNeverInlineKind, r as parseInlines, t as InlineParseOptions } from "../inline-B8WNyxnI.cjs";
1
+ import { n as assertNeverInlineKind, r as parseInlines, t as InlineParseOptions } from "../inline-GzD5QtFh.cjs";
2
2
  export { InlineParseOptions, assertNeverInlineKind, parseInlines };
@@ -1,2 +1,2 @@
1
- import { n as assertNeverInlineKind, r as parseInlines, t as InlineParseOptions } from "../inline-BBtsaDjb.js";
1
+ import { n as assertNeverInlineKind, r as parseInlines, t as InlineParseOptions } from "../inline-CArcArOD.js";
2
2
  export { InlineParseOptions, assertNeverInlineKind, parseInlines };
@@ -1,4 +1,4 @@
1
- import { v as MarkdownInlineNode } from "./ast-CNfTgS0N.js";
1
+ import { y as MarkdownInlineNode } from "./ast-DI-t9uKv.js";
2
2
  import { r as FootnoteLabelSet } from "./footnote-CKk4JbLk.js";
3
3
  import { LinkReferenceMap } from "./inline/link.js";
4
4
  //#region src/inline/inline.d.ts
@@ -1,4 +1,4 @@
1
- import { v as MarkdownInlineNode } from "./ast-CNfTgS0N.cjs";
1
+ import { y as MarkdownInlineNode } from "./ast-DI-t9uKv.cjs";
2
2
  import { r as FootnoteLabelSet } from "./footnote-CKk4JbLk.cjs";
3
3
  import { LinkReferenceMap } from "./inline/link.cjs";
4
4
  //#region src/inline/inline.d.ts
@@ -1,4 +1,4 @@
1
- import { v as MarkdownInlineNode } from "../ast-CNfTgS0N.cjs";
1
+ import { y as MarkdownInlineNode } from "../ast-DI-t9uKv.cjs";
2
2
  import { i as MarkdownDiagnosticSink } from "../diagnostics-D3UiC9HL.cjs";
3
3
  import { ContentRun, RunConstructExtent } from "document-schema.js";
4
4
  //#region src/lower/inline.d.ts
@@ -1,4 +1,4 @@
1
- import { v as MarkdownInlineNode } from "../ast-CNfTgS0N.js";
1
+ import { y as MarkdownInlineNode } from "../ast-DI-t9uKv.js";
2
2
  import { i as MarkdownDiagnosticSink } from "../diagnostics-D3UiC9HL.js";
3
3
  import { ContentRun, RunConstructExtent } from "document-schema.js";
4
4
  //#region src/lower/inline.d.ts
@@ -1,4 +1,4 @@
1
- import { F as MarkdownTableNode } from "../ast-CNfTgS0N.cjs";
1
+ import { I as MarkdownTableNode } from "../ast-DI-t9uKv.cjs";
2
2
  import { InlineLowerContext } from "./inline.cjs";
3
3
  import { ContentTable } from "document-schema.js";
4
4
  //#region src/lower/table.d.ts
@@ -1,4 +1,4 @@
1
- import { F as MarkdownTableNode } from "../ast-CNfTgS0N.js";
1
+ import { I as MarkdownTableNode } from "../ast-DI-t9uKv.js";
2
2
  import { InlineLowerContext } from "./inline.js";
3
3
  import { ContentTable } from "document-schema.js";
4
4
  //#region src/lower/table.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdown-codec",
3
- "version": "11.1.9",
3
+ "version": "11.1.10",
4
4
  "description": "Hand-written CommonMark+GFM <-> DocumentTree codec, built on document-schema.js",
5
5
  "type": "module",
6
6
  "repository": {