markdown-codec 6.7.4 → 6.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/block/block.cjs +19 -37
- package/dist/block/block.js +20 -38
- package/dist/block/definitions.cjs +1 -5
- package/dist/block/definitions.js +1 -5
- package/dist/block/line.cjs +2 -2
- package/dist/block/line.js +2 -2
- package/dist/block/list.cjs +7 -14
- package/dist/block/list.js +7 -14
- package/dist/block/node.cjs +3 -3
- package/dist/block/node.d.cts +2 -2
- package/dist/block/node.d.ts +2 -2
- package/dist/block/node.js +3 -3
- package/dist/block/table.cjs +3 -4
- package/dist/block/table.js +3 -4
- package/dist/codec.d.cts +36 -36
- package/dist/codec.d.ts +36 -36
- package/dist/emit/emit.cjs +58 -62
- package/dist/emit/emit.js +58 -62
- package/dist/emit/inline.cjs +18 -12
- package/dist/emit/inline.js +18 -12
- package/dist/emit/table.cjs +2 -2
- package/dist/emit/table.js +2 -2
- package/dist/html/html-table.cjs +14 -22
- package/dist/html/html-table.js +14 -22
- package/dist/html/html.cjs +0 -2
- package/dist/html/html.js +0 -2
- package/dist/html/render.cjs +3 -11
- package/dist/html/render.js +3 -11
- package/dist/image/image.cjs +8 -57
- package/dist/image/image.d.cts +2 -2
- package/dist/image/image.d.ts +2 -2
- package/dist/image/image.js +9 -56
- package/dist/{image-BtmTG4_a.d.cts → image-83yql5ES.d.cts} +1 -3
- package/dist/{image-BtmTG4_a.d.ts → image-83yql5ES.d.ts} +1 -3
- package/dist/{image-B5L0HpAJ.d.cts → image-B6p0Ovgy.d.cts} +1 -1
- package/dist/{image-C390OIB3.d.ts → image-gR1vISI0.d.ts} +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/inline/chars.cjs +3 -6
- package/dist/inline/chars.js +3 -6
- package/dist/inline/delimiter.cjs +5 -16
- package/dist/inline/delimiter.d.cts +2 -2
- package/dist/inline/delimiter.d.ts +2 -2
- package/dist/inline/delimiter.js +5 -16
- package/dist/inline/entity.cjs +6 -10
- package/dist/inline/entity.js +6 -10
- package/dist/inline/gfm-autolink.cjs +20 -19
- package/dist/inline/gfm-autolink.js +20 -19
- package/dist/inline/inline.cjs +29 -39
- package/dist/inline/inline.js +30 -40
- package/dist/inline/link.cjs +4 -5
- package/dist/inline/link.js +4 -5
- package/dist/lower/front-matter.cjs +4 -8
- package/dist/lower/front-matter.js +4 -8
- package/dist/lower/image.cjs +3 -2
- package/dist/lower/image.d.cts +1 -1
- package/dist/lower/image.d.ts +1 -1
- package/dist/lower/image.js +2 -1
- package/dist/lower/inline.cjs +0 -2
- package/dist/lower/inline.js +0 -2
- package/dist/lower/lower.cjs +7 -10
- package/dist/lower/lower.js +7 -10
- package/dist/options/options.d.cts +1 -1
- package/dist/options/options.d.ts +1 -1
- package/dist/read.cjs +2 -2
- package/dist/read.js +2 -2
- package/dist/scan/scan.cjs +1 -3
- package/dist/scan/scan.js +1 -3
- package/dist/shared/list-id.cjs +1 -1
- package/dist/shared/list-id.js +1 -1
- package/package.json +2 -1
package/dist/inline/link.js
CHANGED
|
@@ -8,7 +8,7 @@ function normalizeLinkLabel(labelWithBrackets) {
|
|
|
8
8
|
function matchLinkLabel(text, start) {
|
|
9
9
|
if (text.charAt(start) !== "[") return 0;
|
|
10
10
|
let index = start + 1;
|
|
11
|
-
while (index
|
|
11
|
+
while (text.charAt(index) !== "") {
|
|
12
12
|
const char = text.charAt(index);
|
|
13
13
|
if (char === "\\") {
|
|
14
14
|
index += 2;
|
|
@@ -26,7 +26,7 @@ function matchLinkLabel(text, start) {
|
|
|
26
26
|
function parseLinkDestination(text, start) {
|
|
27
27
|
if (text.charAt(start) === "<") {
|
|
28
28
|
let index = start + 1;
|
|
29
|
-
while (index
|
|
29
|
+
while (text.charAt(index) !== "") {
|
|
30
30
|
const char = text.charAt(index);
|
|
31
31
|
if (char === "\\") {
|
|
32
32
|
index += 2;
|
|
@@ -78,9 +78,8 @@ const TITLE_DELIMITERS = /* @__PURE__ */ new Map([
|
|
|
78
78
|
function parseLinkTitle(text, start) {
|
|
79
79
|
const opener = text.charAt(start);
|
|
80
80
|
const closer = TITLE_DELIMITERS.get(opener);
|
|
81
|
-
if (closer === void 0) return;
|
|
82
81
|
let index = start + 1;
|
|
83
|
-
while (index
|
|
82
|
+
while (text.charAt(index) !== "") {
|
|
84
83
|
const char = text.charAt(index);
|
|
85
84
|
if (char === "\\") {
|
|
86
85
|
index += 2;
|
|
@@ -97,7 +96,7 @@ function parseLinkTitle(text, start) {
|
|
|
97
96
|
function skipInlineWhitespace(text, start) {
|
|
98
97
|
let index = start;
|
|
99
98
|
let seenLineEnding = false;
|
|
100
|
-
|
|
99
|
+
for (;;) {
|
|
101
100
|
const char = text.charAt(index);
|
|
102
101
|
if (char === "\n") {
|
|
103
102
|
if (seenLineEnding) break;
|
|
@@ -73,20 +73,16 @@ function extractFrontMatter(source, sink = require_diagnostics_diagnostics.NOOP_
|
|
|
73
73
|
rest: source,
|
|
74
74
|
source: void 0
|
|
75
75
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
closingIndex = index;
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
76
|
+
const closingOffset = lines.slice(1).findIndex((line) => CLOSING_DELIMITER_PATTERN.test(line));
|
|
77
|
+
const closingIndex = closingOffset === -1 ? -1 : closingOffset + 1;
|
|
81
78
|
if (closingIndex === -1) return {
|
|
82
79
|
metadata: {},
|
|
83
80
|
rest: source,
|
|
84
81
|
source: void 0
|
|
85
82
|
};
|
|
86
83
|
const metadata = {};
|
|
87
|
-
for (
|
|
88
|
-
const
|
|
89
|
-
if (line.trim().length === 0) continue;
|
|
84
|
+
for (const [offset, line] of lines.slice(1, closingIndex).entries()) {
|
|
85
|
+
const index = offset + 1;
|
|
90
86
|
const match = KEY_VALUE_LINE_PATTERN.exec(line);
|
|
91
87
|
const key = match?.[1];
|
|
92
88
|
const value = match?.[2];
|
|
@@ -72,20 +72,16 @@ function extractFrontMatter(source, sink = NOOP_MARKDOWN_DIAGNOSTIC_SINK) {
|
|
|
72
72
|
rest: source,
|
|
73
73
|
source: void 0
|
|
74
74
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
closingIndex = index;
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
75
|
+
const closingOffset = lines.slice(1).findIndex((line) => CLOSING_DELIMITER_PATTERN.test(line));
|
|
76
|
+
const closingIndex = closingOffset === -1 ? -1 : closingOffset + 1;
|
|
80
77
|
if (closingIndex === -1) return {
|
|
81
78
|
metadata: {},
|
|
82
79
|
rest: source,
|
|
83
80
|
source: void 0
|
|
84
81
|
};
|
|
85
82
|
const metadata = {};
|
|
86
|
-
for (
|
|
87
|
-
const
|
|
88
|
-
if (line.trim().length === 0) continue;
|
|
83
|
+
for (const [offset, line] of lines.slice(1, closingIndex).entries()) {
|
|
84
|
+
const index = offset + 1;
|
|
89
85
|
const match = KEY_VALUE_LINE_PATTERN.exec(line);
|
|
90
86
|
const key = match?.[1];
|
|
91
87
|
const value = match?.[2];
|
package/dist/lower/image.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_image_image = require("../image/image.cjs");
|
|
3
|
+
let byte_codec = require("byte-codec");
|
|
3
4
|
//#region src/lower/image.ts
|
|
4
5
|
const POINTS_PER_PIXEL = 72 / 96;
|
|
5
6
|
const DATA_URI_PATTERN = /^data:image\/(?:png|jpe?g);base64,(.+)$/is;
|
|
@@ -7,7 +8,7 @@ function decodeDataUriImage(destination) {
|
|
|
7
8
|
const base64 = DATA_URI_PATTERN.exec(destination)?.[1];
|
|
8
9
|
if (base64 === void 0) return;
|
|
9
10
|
try {
|
|
10
|
-
return
|
|
11
|
+
return (0, byte_codec.base64ToBytes)(base64);
|
|
11
12
|
} catch {
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
@@ -20,7 +21,7 @@ function resolveMarkdownImage(destination, context, resolver) {
|
|
|
20
21
|
if (format === void 0 || dimensions === void 0) return;
|
|
21
22
|
return {
|
|
22
23
|
format,
|
|
23
|
-
base64:
|
|
24
|
+
base64: (0, byte_codec.bytesToBase64)(bytes),
|
|
24
25
|
widthPt: dimensions.widthPx * POINTS_PER_PIXEL,
|
|
25
26
|
heightPt: dimensions.heightPx * POINTS_PER_PIXEL
|
|
26
27
|
};
|
package/dist/lower/image.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveMarkdownImage, i as ResolvedMarkdownImage, n as MarkdownImageResolver, r as MarkdownResolvedImageBytes, t as MarkdownImageResolveContext } from "../image-
|
|
1
|
+
import { a as resolveMarkdownImage, i as ResolvedMarkdownImage, n as MarkdownImageResolver, r as MarkdownResolvedImageBytes, t as MarkdownImageResolveContext } from "../image-B6p0Ovgy.cjs";
|
|
2
2
|
export { MarkdownImageResolveContext, MarkdownImageResolver, MarkdownResolvedImageBytes, ResolvedMarkdownImage, resolveMarkdownImage };
|
package/dist/lower/image.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveMarkdownImage, i as ResolvedMarkdownImage, n as MarkdownImageResolver, r as MarkdownResolvedImageBytes, t as MarkdownImageResolveContext } from "../image-
|
|
1
|
+
import { a as resolveMarkdownImage, i as ResolvedMarkdownImage, n as MarkdownImageResolver, r as MarkdownResolvedImageBytes, t as MarkdownImageResolveContext } from "../image-gR1vISI0.js";
|
|
2
2
|
export { MarkdownImageResolveContext, MarkdownImageResolver, MarkdownResolvedImageBytes, ResolvedMarkdownImage, resolveMarkdownImage };
|
package/dist/lower/image.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { detectImageFormat, readImageDimensions } from "../image/image.js";
|
|
2
|
+
import { base64ToBytes, bytesToBase64 } from "byte-codec";
|
|
2
3
|
//#region src/lower/image.ts
|
|
3
4
|
const POINTS_PER_PIXEL = 72 / 96;
|
|
4
5
|
const DATA_URI_PATTERN = /^data:image\/(?:png|jpe?g);base64,(.+)$/is;
|
package/dist/lower/inline.cjs
CHANGED
|
@@ -27,8 +27,6 @@ function lowerNestedEmphasisLike(kind, node, style, context, runs, extents) {
|
|
|
27
27
|
function lowerInlineNodeInto(node, style, context, runs, extents) {
|
|
28
28
|
switch (node.type) {
|
|
29
29
|
case "text":
|
|
30
|
-
if (node.value.length > 0) runs.push(buildRun(node.value, style));
|
|
31
|
-
return;
|
|
32
30
|
case "entity":
|
|
33
31
|
if (node.value.length > 0) runs.push(buildRun(node.value, style));
|
|
34
32
|
return;
|
package/dist/lower/inline.js
CHANGED
|
@@ -26,8 +26,6 @@ function lowerNestedEmphasisLike(kind, node, style, context, runs, extents) {
|
|
|
26
26
|
function lowerInlineNodeInto(node, style, context, runs, extents) {
|
|
27
27
|
switch (node.type) {
|
|
28
28
|
case "text":
|
|
29
|
-
if (node.value.length > 0) runs.push(buildRun(node.value, style));
|
|
30
|
-
return;
|
|
31
29
|
case "entity":
|
|
32
30
|
if (node.value.length > 0) runs.push(buildRun(node.value, style));
|
|
33
31
|
return;
|
package/dist/lower/lower.cjs
CHANGED
|
@@ -49,8 +49,8 @@ function lowerParagraph(node, context) {
|
|
|
49
49
|
const blocks = [];
|
|
50
50
|
const inlineCtx = inlineContext(context);
|
|
51
51
|
let segment = [];
|
|
52
|
-
const flushSegment = (
|
|
53
|
-
if (segment.length === 0
|
|
52
|
+
const flushSegment = () => {
|
|
53
|
+
if (segment.length === 0) return;
|
|
54
54
|
const inline = require_lower_inline.lowerInlineNodes(segment, inlineCtx);
|
|
55
55
|
blocks.push(decorateParagraph({
|
|
56
56
|
kind: "paragraph",
|
|
@@ -76,7 +76,7 @@ function lowerParagraph(node, context) {
|
|
|
76
76
|
segment.push(child);
|
|
77
77
|
continue;
|
|
78
78
|
}
|
|
79
|
-
flushSegment(
|
|
79
|
+
flushSegment();
|
|
80
80
|
if (context.list !== void 0) context.sink({
|
|
81
81
|
code: require_diagnostics_diagnostics.MarkdownDiagnosticCodes.LIST_ITEM_BLOCK_UNLISTED,
|
|
82
82
|
severity: "info",
|
|
@@ -106,7 +106,7 @@ function lowerParagraph(node, context) {
|
|
|
106
106
|
}
|
|
107
107
|
}, image, { kind: "constructEnd" });
|
|
108
108
|
}
|
|
109
|
-
flushSegment(
|
|
109
|
+
flushSegment();
|
|
110
110
|
return blocks;
|
|
111
111
|
}
|
|
112
112
|
function splitInfoString(infoString) {
|
|
@@ -176,10 +176,9 @@ function lowerHtmlBlock(node, context, contentWidthPt) {
|
|
|
176
176
|
severity: "info",
|
|
177
177
|
message: "block-level raw HTML was preserved as literal text (styleId \"HTMLPreformatted\"); it will not be rendered as HTML by any consumer of the resulting ContentDocument, and its verbatim original rides the paragraph's own markdown residue for this package's writer to re-emit as-is"
|
|
178
178
|
});
|
|
179
|
-
const literal = node.literal.replace(/\n+$/, "");
|
|
180
179
|
return [decorateParagraph({
|
|
181
180
|
kind: "paragraph",
|
|
182
|
-
runs:
|
|
181
|
+
runs: [{ text: node.literal }],
|
|
183
182
|
styleId: require_shared_style_constants.HTML_PREFORMATTED_STYLE_ID,
|
|
184
183
|
source: {
|
|
185
184
|
format: "markdown",
|
|
@@ -242,7 +241,6 @@ function lowerListItem(item, numId, level, context, contentWidthPt) {
|
|
|
242
241
|
list: membership
|
|
243
242
|
};
|
|
244
243
|
const blocks = [];
|
|
245
|
-
let ownLevelBlockCount = 0;
|
|
246
244
|
let firstOwnBlock;
|
|
247
245
|
for (const child of item.children) {
|
|
248
246
|
if (child.type === "list") {
|
|
@@ -250,11 +248,10 @@ function lowerListItem(item, numId, level, context, contentWidthPt) {
|
|
|
250
248
|
continue;
|
|
251
249
|
}
|
|
252
250
|
const childBlocks = lowerBlock(child, itemContext, contentWidthPt);
|
|
253
|
-
ownLevelBlockCount += childBlocks.length;
|
|
254
251
|
firstOwnBlock ??= childBlocks[0];
|
|
255
252
|
blocks.push(...childBlocks);
|
|
256
253
|
}
|
|
257
|
-
if (
|
|
254
|
+
if (firstOwnBlock === void 0 || firstOwnBlock.kind === "constructStart") blocks.unshift(decorateParagraph({
|
|
258
255
|
kind: "paragraph",
|
|
259
256
|
runs: []
|
|
260
257
|
}, itemContext));
|
|
@@ -274,7 +271,7 @@ function lowerList(node, ancestorNumId, level, context, contentWidthPt) {
|
|
|
274
271
|
} else {
|
|
275
272
|
numId = ancestorNumId;
|
|
276
273
|
const mintedType = require_shared_list_id.mintedListType(numId);
|
|
277
|
-
if (mintedType
|
|
274
|
+
if (mintedType === (node.markerType === "bullet" ? "ordered" : "bullet")) context.sink({
|
|
278
275
|
code: require_diagnostics_diagnostics.MarkdownDiagnosticCodes.LIST_MARKER_TYPE_CONFLICT,
|
|
279
276
|
severity: "warning",
|
|
280
277
|
message: `a nested ${node.markerType} list sits under a list minted as ${mintedType}; the enclosing list's own marker type is kept (first-wins) and this nested list's own type is not separately represented`
|
package/dist/lower/lower.js
CHANGED
|
@@ -48,8 +48,8 @@ function lowerParagraph(node, context) {
|
|
|
48
48
|
const blocks = [];
|
|
49
49
|
const inlineCtx = inlineContext(context);
|
|
50
50
|
let segment = [];
|
|
51
|
-
const flushSegment = (
|
|
52
|
-
if (segment.length === 0
|
|
51
|
+
const flushSegment = () => {
|
|
52
|
+
if (segment.length === 0) return;
|
|
53
53
|
const inline = lowerInlineNodes(segment, inlineCtx);
|
|
54
54
|
blocks.push(decorateParagraph({
|
|
55
55
|
kind: "paragraph",
|
|
@@ -75,7 +75,7 @@ function lowerParagraph(node, context) {
|
|
|
75
75
|
segment.push(child);
|
|
76
76
|
continue;
|
|
77
77
|
}
|
|
78
|
-
flushSegment(
|
|
78
|
+
flushSegment();
|
|
79
79
|
if (context.list !== void 0) context.sink({
|
|
80
80
|
code: MarkdownDiagnosticCodes.LIST_ITEM_BLOCK_UNLISTED,
|
|
81
81
|
severity: "info",
|
|
@@ -105,7 +105,7 @@ function lowerParagraph(node, context) {
|
|
|
105
105
|
}
|
|
106
106
|
}, image, { kind: "constructEnd" });
|
|
107
107
|
}
|
|
108
|
-
flushSegment(
|
|
108
|
+
flushSegment();
|
|
109
109
|
return blocks;
|
|
110
110
|
}
|
|
111
111
|
function splitInfoString(infoString) {
|
|
@@ -175,10 +175,9 @@ function lowerHtmlBlock(node, context, contentWidthPt) {
|
|
|
175
175
|
severity: "info",
|
|
176
176
|
message: "block-level raw HTML was preserved as literal text (styleId \"HTMLPreformatted\"); it will not be rendered as HTML by any consumer of the resulting ContentDocument, and its verbatim original rides the paragraph's own markdown residue for this package's writer to re-emit as-is"
|
|
177
177
|
});
|
|
178
|
-
const literal = node.literal.replace(/\n+$/, "");
|
|
179
178
|
return [decorateParagraph({
|
|
180
179
|
kind: "paragraph",
|
|
181
|
-
runs:
|
|
180
|
+
runs: [{ text: node.literal }],
|
|
182
181
|
styleId: HTML_PREFORMATTED_STYLE_ID,
|
|
183
182
|
source: {
|
|
184
183
|
format: "markdown",
|
|
@@ -241,7 +240,6 @@ function lowerListItem(item, numId, level, context, contentWidthPt) {
|
|
|
241
240
|
list: membership
|
|
242
241
|
};
|
|
243
242
|
const blocks = [];
|
|
244
|
-
let ownLevelBlockCount = 0;
|
|
245
243
|
let firstOwnBlock;
|
|
246
244
|
for (const child of item.children) {
|
|
247
245
|
if (child.type === "list") {
|
|
@@ -249,11 +247,10 @@ function lowerListItem(item, numId, level, context, contentWidthPt) {
|
|
|
249
247
|
continue;
|
|
250
248
|
}
|
|
251
249
|
const childBlocks = lowerBlock(child, itemContext, contentWidthPt);
|
|
252
|
-
ownLevelBlockCount += childBlocks.length;
|
|
253
250
|
firstOwnBlock ??= childBlocks[0];
|
|
254
251
|
blocks.push(...childBlocks);
|
|
255
252
|
}
|
|
256
|
-
if (
|
|
253
|
+
if (firstOwnBlock === void 0 || firstOwnBlock.kind === "constructStart") blocks.unshift(decorateParagraph({
|
|
257
254
|
kind: "paragraph",
|
|
258
255
|
runs: []
|
|
259
256
|
}, itemContext));
|
|
@@ -273,7 +270,7 @@ function lowerList(node, ancestorNumId, level, context, contentWidthPt) {
|
|
|
273
270
|
} else {
|
|
274
271
|
numId = ancestorNumId;
|
|
275
272
|
const mintedType = mintedListType(numId);
|
|
276
|
-
if (mintedType
|
|
273
|
+
if (mintedType === (node.markerType === "bullet" ? "ordered" : "bullet")) context.sink({
|
|
277
274
|
code: MarkdownDiagnosticCodes.LIST_MARKER_TYPE_CONFLICT,
|
|
278
275
|
severity: "warning",
|
|
279
276
|
message: `a nested ${node.markerType} list sits under a list minted as ${mintedType}; the enclosing list's own marker type is kept (first-wins) and this nested list's own type is not separately represented`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as MarkdownDiagnosticSink } from "../diagnostics-CjfBoW4K.cjs";
|
|
2
|
-
import { n as MarkdownImageResolver } from "../image-
|
|
2
|
+
import { n as MarkdownImageResolver } from "../image-B6p0Ovgy.cjs";
|
|
3
3
|
import { Margins, PageSize } from "document-schema.js";
|
|
4
4
|
//#region src/options/options.d.ts
|
|
5
5
|
interface ReadMarkdownOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as MarkdownDiagnosticSink } from "../diagnostics-CjfBoW4K.js";
|
|
2
|
-
import { n as MarkdownImageResolver } from "../image-
|
|
2
|
+
import { n as MarkdownImageResolver } from "../image-gR1vISI0.js";
|
|
3
3
|
import { Margins, PageSize } from "document-schema.js";
|
|
4
4
|
//#region src/options/options.d.ts
|
|
5
5
|
interface ReadMarkdownOptions {
|
package/dist/read.cjs
CHANGED
|
@@ -39,14 +39,14 @@ function readMarkdown(text, options = {}) {
|
|
|
39
39
|
xml: detail.frontMatterSource
|
|
40
40
|
};
|
|
41
41
|
return {
|
|
42
|
-
documentPackage:
|
|
42
|
+
documentPackage: {
|
|
43
43
|
...assembled,
|
|
44
44
|
...definitions !== void 0 ? { definitions: {
|
|
45
45
|
...assembled.definitions,
|
|
46
46
|
...definitions
|
|
47
47
|
} } : {},
|
|
48
48
|
...frontMatterResidue !== void 0 ? { source: {
|
|
49
|
-
...assembled.source
|
|
49
|
+
...assembled.source,
|
|
50
50
|
frontmatter: frontMatterResidue
|
|
51
51
|
} } : {}
|
|
52
52
|
},
|
package/dist/read.js
CHANGED
|
@@ -38,14 +38,14 @@ function readMarkdown(text, options = {}) {
|
|
|
38
38
|
xml: detail.frontMatterSource
|
|
39
39
|
};
|
|
40
40
|
return {
|
|
41
|
-
documentPackage:
|
|
41
|
+
documentPackage: {
|
|
42
42
|
...assembled,
|
|
43
43
|
...definitions !== void 0 ? { definitions: {
|
|
44
44
|
...assembled.definitions,
|
|
45
45
|
...definitions
|
|
46
46
|
} } : {},
|
|
47
47
|
...frontMatterResidue !== void 0 ? { source: {
|
|
48
|
-
...assembled.source
|
|
48
|
+
...assembled.source,
|
|
49
49
|
frontmatter: frontMatterResidue
|
|
50
50
|
} } : {}
|
|
51
51
|
},
|
package/dist/scan/scan.cjs
CHANGED
|
@@ -18,11 +18,9 @@ var MarkdownScanCursor = class {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
atEnd() {
|
|
21
|
-
return this.
|
|
21
|
+
return this.rawOffset >= this.source.length;
|
|
22
22
|
}
|
|
23
23
|
peek() {
|
|
24
|
-
if (this.pendingTabColumns > 0) return " ";
|
|
25
|
-
if (this.rawOffset >= this.source.length) return;
|
|
26
24
|
const char = this.source[this.rawOffset];
|
|
27
25
|
if (char === " ") return " ";
|
|
28
26
|
if (char === "\r") return "\n";
|
package/dist/scan/scan.js
CHANGED
|
@@ -17,11 +17,9 @@ var MarkdownScanCursor = class {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
atEnd() {
|
|
20
|
-
return this.
|
|
20
|
+
return this.rawOffset >= this.source.length;
|
|
21
21
|
}
|
|
22
22
|
peek() {
|
|
23
|
-
if (this.pendingTabColumns > 0) return " ";
|
|
24
|
-
if (this.rawOffset >= this.source.length) return;
|
|
25
23
|
const char = this.source[this.rawOffset];
|
|
26
24
|
if (char === " ") return " ";
|
|
27
25
|
if (char === "\r") return "\n";
|
package/dist/shared/list-id.cjs
CHANGED
|
@@ -18,7 +18,7 @@ function parseListNumId(numId) {
|
|
|
18
18
|
const match = NUMID_PATTERN.exec(numId);
|
|
19
19
|
if (match === null) return;
|
|
20
20
|
const type = match[2];
|
|
21
|
-
if (type
|
|
21
|
+
if (type !== "bullet" && type !== "ordered") return;
|
|
22
22
|
const startText = match[3];
|
|
23
23
|
return {
|
|
24
24
|
type,
|
package/dist/shared/list-id.js
CHANGED
|
@@ -17,7 +17,7 @@ function parseListNumId(numId) {
|
|
|
17
17
|
const match = NUMID_PATTERN.exec(numId);
|
|
18
18
|
if (match === null) return;
|
|
19
19
|
const type = match[2];
|
|
20
|
-
if (type
|
|
20
|
+
if (type !== "bullet" && type !== "ordered") return;
|
|
21
21
|
const startText = match[3];
|
|
22
22
|
return {
|
|
23
23
|
type,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdown-codec",
|
|
3
|
-
"version": "6.7.
|
|
3
|
+
"version": "6.7.6",
|
|
4
4
|
"description": "Hand-written CommonMark+GFM <-> DocumentTree codec, built on document-schema.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"license": "MIT",
|
|
84
84
|
"packageManager": "pnpm@12.4.1+sha512.2e81e399d73fe8390dab25e06aa788ab7a5908248d2f5a370f82b481147a6a7a367bf8048f9a6fdb6460f21a66f0542dedb8b94ca2c8723596741920b1656d4c",
|
|
85
85
|
"dependencies": {
|
|
86
|
+
"byte-codec": "1.6.1",
|
|
86
87
|
"document-schema.js": "7.11.4",
|
|
87
88
|
"zod": "4.4.3"
|
|
88
89
|
},
|