mrkdwn.js 11.1.7 → 11.1.9
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/block/block.cjs +7 -0
- package/dist/block/block.d.cts +3 -2
- package/dist/block/block.d.ts +3 -2
- package/dist/block/block.js +7 -1
- package/dist/codec.d.cts +28 -28
- package/dist/codec.d.ts +28 -28
- package/dist/emit/emit.cjs +7 -2
- package/dist/emit/emit.d.cts +2 -1
- package/dist/emit/emit.d.ts +2 -1
- package/dist/emit/emit.js +7 -3
- package/dist/emit/table.cjs +5 -0
- package/dist/emit/table.d.cts +2 -1
- package/dist/emit/table.d.ts +2 -1
- package/dist/emit/table.js +5 -1
- package/dist/html/render.cjs +5 -0
- package/dist/html/render.d.cts +2 -1
- package/dist/html/render.d.ts +2 -1
- package/dist/html/render.js +5 -1
- package/dist/inline/inline.cjs +5 -0
- package/dist/inline/inline.d.cts +2 -2
- package/dist/inline/inline.d.ts +2 -2
- package/dist/inline/inline.js +5 -1
- package/dist/{inline-CnO86zMw.d.cts → inline-B8WNyxnI.d.cts} +2 -1
- package/dist/{inline-DItZ-VVw.d.ts → inline-BBtsaDjb.d.ts} +2 -1
- package/dist/lower/lower.cjs +5 -0
- package/dist/lower/lower.d.cts +2 -1
- package/dist/lower/lower.d.ts +2 -1
- package/dist/lower/lower.js +5 -1
- package/package.json +2 -2
package/dist/block/block.cjs
CHANGED
|
@@ -138,6 +138,7 @@ var BlockParser = class {
|
|
|
138
138
|
case "heading":
|
|
139
139
|
case "thematicBreak": return "not-matched";
|
|
140
140
|
}
|
|
141
|
+
return assertNeverBlockKind(node.kind);
|
|
141
142
|
}
|
|
142
143
|
continueBlockquote() {
|
|
143
144
|
if (!this.consumeBlockquoteMarker()) return "not-matched";
|
|
@@ -437,6 +438,7 @@ var BlockParser = class {
|
|
|
437
438
|
case "list":
|
|
438
439
|
require_block_list.finalizeListTightness(node);
|
|
439
440
|
return;
|
|
441
|
+
default: return;
|
|
440
442
|
}
|
|
441
443
|
}
|
|
442
444
|
finalizeCodeBlock(node) {
|
|
@@ -577,6 +579,7 @@ function toAstBlock(node, context) {
|
|
|
577
579
|
case "document":
|
|
578
580
|
case "listItem": return;
|
|
579
581
|
}
|
|
582
|
+
return assertNeverBlockKind(node.kind);
|
|
580
583
|
}
|
|
581
584
|
function toAstBlocks(nodes, context) {
|
|
582
585
|
const blocks = [];
|
|
@@ -603,9 +606,13 @@ function parseMarkdown(source, options = {}) {
|
|
|
603
606
|
footnotes: context.footnotes
|
|
604
607
|
};
|
|
605
608
|
}
|
|
609
|
+
function assertNeverBlockKind(kind) {
|
|
610
|
+
throw new Error(`markdown-codec: unhandled block kind ${JSON.stringify(kind)}`);
|
|
611
|
+
}
|
|
606
612
|
//#endregion
|
|
607
613
|
exports.ATX_MARKER_PATTERN = ATX_MARKER_PATTERN;
|
|
608
614
|
exports.CODE_FENCE_PATTERN = CODE_FENCE_PATTERN;
|
|
609
615
|
exports.MATH_BLOCK_MARKER_PATTERN = MATH_BLOCK_MARKER_PATTERN;
|
|
610
616
|
exports.THEMATIC_BREAK_PATTERN = THEMATIC_BREAK_PATTERN;
|
|
617
|
+
exports.assertNeverBlockKind = assertNeverBlockKind;
|
|
611
618
|
exports.parseMarkdown = parseMarkdown;
|
package/dist/block/block.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { s as MarkdownDocumentNode } from "../ast-CNfTgS0N.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-
|
|
5
|
+
import { t as InlineParseOptions } from "../inline-B8WNyxnI.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;
|
|
@@ -21,5 +21,6 @@ interface ParsedMarkdown {
|
|
|
21
21
|
readonly footnotes: FootnoteLabelSet;
|
|
22
22
|
}
|
|
23
23
|
declare function parseMarkdown(source: string, options?: MarkdownParseOptions): ParsedMarkdown;
|
|
24
|
+
declare function assertNeverBlockKind(kind: never): never;
|
|
24
25
|
//#endregion
|
|
25
|
-
export { ATX_MARKER_PATTERN, CODE_FENCE_PATTERN, MATH_BLOCK_MARKER_PATTERN, MarkdownParseOptions, ParsedMarkdown, THEMATIC_BREAK_PATTERN, parseMarkdown };
|
|
26
|
+
export { ATX_MARKER_PATTERN, CODE_FENCE_PATTERN, MATH_BLOCK_MARKER_PATTERN, MarkdownParseOptions, ParsedMarkdown, THEMATIC_BREAK_PATTERN, assertNeverBlockKind, parseMarkdown };
|
package/dist/block/block.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { s as MarkdownDocumentNode } from "../ast-CNfTgS0N.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-
|
|
5
|
+
import { t as InlineParseOptions } from "../inline-BBtsaDjb.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;
|
|
@@ -21,5 +21,6 @@ interface ParsedMarkdown {
|
|
|
21
21
|
readonly footnotes: FootnoteLabelSet;
|
|
22
22
|
}
|
|
23
23
|
declare function parseMarkdown(source: string, options?: MarkdownParseOptions): ParsedMarkdown;
|
|
24
|
+
declare function assertNeverBlockKind(kind: never): never;
|
|
24
25
|
//#endregion
|
|
25
|
-
export { ATX_MARKER_PATTERN, CODE_FENCE_PATTERN, MATH_BLOCK_MARKER_PATTERN, MarkdownParseOptions, ParsedMarkdown, THEMATIC_BREAK_PATTERN, parseMarkdown };
|
|
26
|
+
export { ATX_MARKER_PATTERN, CODE_FENCE_PATTERN, MATH_BLOCK_MARKER_PATTERN, MarkdownParseOptions, ParsedMarkdown, THEMATIC_BREAK_PATTERN, assertNeverBlockKind, parseMarkdown };
|
package/dist/block/block.js
CHANGED
|
@@ -137,6 +137,7 @@ var BlockParser = class {
|
|
|
137
137
|
case "heading":
|
|
138
138
|
case "thematicBreak": return "not-matched";
|
|
139
139
|
}
|
|
140
|
+
return assertNeverBlockKind(node.kind);
|
|
140
141
|
}
|
|
141
142
|
continueBlockquote() {
|
|
142
143
|
if (!this.consumeBlockquoteMarker()) return "not-matched";
|
|
@@ -436,6 +437,7 @@ var BlockParser = class {
|
|
|
436
437
|
case "list":
|
|
437
438
|
finalizeListTightness(node);
|
|
438
439
|
return;
|
|
440
|
+
default: return;
|
|
439
441
|
}
|
|
440
442
|
}
|
|
441
443
|
finalizeCodeBlock(node) {
|
|
@@ -576,6 +578,7 @@ function toAstBlock(node, context) {
|
|
|
576
578
|
case "document":
|
|
577
579
|
case "listItem": return;
|
|
578
580
|
}
|
|
581
|
+
return assertNeverBlockKind(node.kind);
|
|
579
582
|
}
|
|
580
583
|
function toAstBlocks(nodes, context) {
|
|
581
584
|
const blocks = [];
|
|
@@ -602,5 +605,8 @@ function parseMarkdown(source, options = {}) {
|
|
|
602
605
|
footnotes: context.footnotes
|
|
603
606
|
};
|
|
604
607
|
}
|
|
608
|
+
function assertNeverBlockKind(kind) {
|
|
609
|
+
throw new Error(`markdown-codec: unhandled block kind ${JSON.stringify(kind)}`);
|
|
610
|
+
}
|
|
605
611
|
//#endregion
|
|
606
|
-
export { ATX_MARKER_PATTERN, CODE_FENCE_PATTERN, MATH_BLOCK_MARKER_PATTERN, THEMATIC_BREAK_PATTERN, parseMarkdown };
|
|
612
|
+
export { ATX_MARKER_PATTERN, CODE_FENCE_PATTERN, MATH_BLOCK_MARKER_PATTERN, THEMATIC_BREAK_PATTERN, assertNeverBlockKind, parseMarkdown };
|
package/dist/codec.d.cts
CHANGED
|
@@ -629,12 +629,12 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
|
|
|
629
629
|
}, z.core.$strip>, z.ZodObject<{
|
|
630
630
|
children: z.ZodArray<z.ZodObject<{
|
|
631
631
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
632
|
+
body: "body";
|
|
632
633
|
chart: "chart";
|
|
633
634
|
diagram: "diagram";
|
|
634
635
|
table: "table";
|
|
635
636
|
image: "image";
|
|
636
637
|
notes: "notes";
|
|
637
|
-
body: "body";
|
|
638
638
|
}>>;
|
|
639
639
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
640
640
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -844,12 +844,12 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
|
|
|
844
844
|
declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
845
845
|
sections: z.ZodArray<z.ZodObject<{
|
|
846
846
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
847
|
+
body: "body";
|
|
847
848
|
chart: "chart";
|
|
848
849
|
diagram: "diagram";
|
|
849
850
|
table: "table";
|
|
850
851
|
image: "image";
|
|
851
852
|
notes: "notes";
|
|
852
|
-
body: "body";
|
|
853
853
|
}>>;
|
|
854
854
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
855
855
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -993,12 +993,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
993
993
|
}, z.core.$strip>, z.ZodObject<{
|
|
994
994
|
slides: z.ZodArray<z.ZodObject<{
|
|
995
995
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
996
|
+
body: "body";
|
|
996
997
|
chart: "chart";
|
|
997
998
|
diagram: "diagram";
|
|
998
999
|
table: "table";
|
|
999
1000
|
image: "image";
|
|
1000
1001
|
notes: "notes";
|
|
1001
|
-
body: "body";
|
|
1002
1002
|
}>>;
|
|
1003
1003
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
1004
1004
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -1026,12 +1026,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
1026
1026
|
shapes: z.ZodArray<z.ZodObject<{
|
|
1027
1027
|
blocks: z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>;
|
|
1028
1028
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
1029
|
+
body: "body";
|
|
1029
1030
|
chart: "chart";
|
|
1030
1031
|
diagram: "diagram";
|
|
1031
1032
|
table: "table";
|
|
1032
1033
|
image: "image";
|
|
1033
1034
|
notes: "notes";
|
|
1034
|
-
body: "body";
|
|
1035
1035
|
}>>;
|
|
1036
1036
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
1037
1037
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -1189,12 +1189,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
1189
1189
|
}, z.core.$strip>, z.ZodObject<{
|
|
1190
1190
|
sheets: z.ZodArray<z.ZodObject<{
|
|
1191
1191
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
1192
|
+
body: "body";
|
|
1192
1193
|
chart: "chart";
|
|
1193
1194
|
diagram: "diagram";
|
|
1194
1195
|
table: "table";
|
|
1195
1196
|
image: "image";
|
|
1196
1197
|
notes: "notes";
|
|
1197
|
-
body: "body";
|
|
1198
1198
|
}>>;
|
|
1199
1199
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
1200
1200
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -1218,12 +1218,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
1218
1218
|
name: z.ZodString;
|
|
1219
1219
|
cells: z.ZodArray<z.ZodObject<{
|
|
1220
1220
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
1221
|
+
body: "body";
|
|
1221
1222
|
chart: "chart";
|
|
1222
1223
|
diagram: "diagram";
|
|
1223
1224
|
table: "table";
|
|
1224
1225
|
image: "image";
|
|
1225
1226
|
notes: "notes";
|
|
1226
|
-
body: "body";
|
|
1227
1227
|
}>>;
|
|
1228
1228
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
1229
1229
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -1298,12 +1298,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
1298
1298
|
}, z.core.$strip>>;
|
|
1299
1299
|
runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1300
1300
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
1301
|
+
body: "body";
|
|
1301
1302
|
chart: "chart";
|
|
1302
1303
|
diagram: "diagram";
|
|
1303
1304
|
table: "table";
|
|
1304
1305
|
image: "image";
|
|
1305
1306
|
notes: "notes";
|
|
1306
|
-
body: "body";
|
|
1307
1307
|
}>>;
|
|
1308
1308
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
1309
1309
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -1597,12 +1597,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
1597
1597
|
}, z.core.$strip>>;
|
|
1598
1598
|
images: z.ZodArray<z.ZodObject<{
|
|
1599
1599
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
1600
|
+
body: "body";
|
|
1600
1601
|
chart: "chart";
|
|
1601
1602
|
diagram: "diagram";
|
|
1602
1603
|
table: "table";
|
|
1603
1604
|
image: "image";
|
|
1604
1605
|
notes: "notes";
|
|
1605
|
-
body: "body";
|
|
1606
1606
|
}>>;
|
|
1607
1607
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
1608
1608
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -1816,9 +1816,9 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
1816
1816
|
endColumn: z.ZodNumber;
|
|
1817
1817
|
}, z.core.$strip>>;
|
|
1818
1818
|
type: z.ZodEnum<{
|
|
1819
|
+
time: "time";
|
|
1819
1820
|
date: "date";
|
|
1820
1821
|
custom: "custom";
|
|
1821
|
-
time: "time";
|
|
1822
1822
|
decimal: "decimal";
|
|
1823
1823
|
list: "list";
|
|
1824
1824
|
whole: "whole";
|
|
@@ -2291,11 +2291,11 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2291
2291
|
stops: z.ZodArray<z.ZodObject<{
|
|
2292
2292
|
value: z.ZodObject<{
|
|
2293
2293
|
type: z.ZodEnum<{
|
|
2294
|
-
formula: "formula";
|
|
2295
2294
|
num: "num";
|
|
2296
|
-
percent: "percent";
|
|
2297
|
-
max: "max";
|
|
2298
2295
|
min: "min";
|
|
2296
|
+
max: "max";
|
|
2297
|
+
formula: "formula";
|
|
2298
|
+
percent: "percent";
|
|
2299
2299
|
percentile: "percentile";
|
|
2300
2300
|
}>;
|
|
2301
2301
|
value: z.ZodOptional<z.ZodString>;
|
|
@@ -2338,22 +2338,22 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2338
2338
|
}, z.core.$strip>, z.ZodObject<{
|
|
2339
2339
|
min: z.ZodObject<{
|
|
2340
2340
|
type: z.ZodEnum<{
|
|
2341
|
-
formula: "formula";
|
|
2342
2341
|
num: "num";
|
|
2343
|
-
percent: "percent";
|
|
2344
|
-
max: "max";
|
|
2345
2342
|
min: "min";
|
|
2343
|
+
max: "max";
|
|
2344
|
+
formula: "formula";
|
|
2345
|
+
percent: "percent";
|
|
2346
2346
|
percentile: "percentile";
|
|
2347
2347
|
}>;
|
|
2348
2348
|
value: z.ZodOptional<z.ZodString>;
|
|
2349
2349
|
}, z.core.$strip>;
|
|
2350
2350
|
max: z.ZodObject<{
|
|
2351
2351
|
type: z.ZodEnum<{
|
|
2352
|
-
formula: "formula";
|
|
2353
2352
|
num: "num";
|
|
2354
|
-
percent: "percent";
|
|
2355
|
-
max: "max";
|
|
2356
2353
|
min: "min";
|
|
2354
|
+
max: "max";
|
|
2355
|
+
formula: "formula";
|
|
2356
|
+
percent: "percent";
|
|
2357
2357
|
percentile: "percentile";
|
|
2358
2358
|
}>;
|
|
2359
2359
|
value: z.ZodOptional<z.ZodString>;
|
|
@@ -2397,11 +2397,11 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2397
2397
|
iconSetType: z.ZodString;
|
|
2398
2398
|
thresholds: z.ZodArray<z.ZodObject<{
|
|
2399
2399
|
type: z.ZodEnum<{
|
|
2400
|
-
formula: "formula";
|
|
2401
2400
|
num: "num";
|
|
2402
|
-
percent: "percent";
|
|
2403
|
-
max: "max";
|
|
2404
2401
|
min: "min";
|
|
2402
|
+
max: "max";
|
|
2403
|
+
formula: "formula";
|
|
2404
|
+
percent: "percent";
|
|
2405
2405
|
percentile: "percentile";
|
|
2406
2406
|
}>;
|
|
2407
2407
|
value: z.ZodOptional<z.ZodString>;
|
|
@@ -2534,12 +2534,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2534
2534
|
}, z.core.$strip>, z.ZodObject<{
|
|
2535
2535
|
pages: z.ZodArray<z.ZodObject<{
|
|
2536
2536
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
2537
|
+
body: "body";
|
|
2537
2538
|
chart: "chart";
|
|
2538
2539
|
diagram: "diagram";
|
|
2539
2540
|
table: "table";
|
|
2540
2541
|
image: "image";
|
|
2541
2542
|
notes: "notes";
|
|
2542
|
-
body: "body";
|
|
2543
2543
|
}>>;
|
|
2544
2544
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
2545
2545
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -2567,12 +2567,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2567
2567
|
shapes: z.ZodArray<z.ZodObject<{
|
|
2568
2568
|
blocks: z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>;
|
|
2569
2569
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
2570
|
+
body: "body";
|
|
2570
2571
|
chart: "chart";
|
|
2571
2572
|
diagram: "diagram";
|
|
2572
2573
|
table: "table";
|
|
2573
2574
|
image: "image";
|
|
2574
2575
|
notes: "notes";
|
|
2575
|
-
body: "body";
|
|
2576
2576
|
}>>;
|
|
2577
2577
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
2578
2578
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -2640,12 +2640,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2640
2640
|
}, z.core.$strip>>;
|
|
2641
2641
|
vectors: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2642
2642
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
2643
|
+
body: "body";
|
|
2643
2644
|
chart: "chart";
|
|
2644
2645
|
diagram: "diagram";
|
|
2645
2646
|
table: "table";
|
|
2646
2647
|
image: "image";
|
|
2647
2648
|
notes: "notes";
|
|
2648
|
-
body: "body";
|
|
2649
2649
|
}>>;
|
|
2650
2650
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
2651
2651
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -2778,12 +2778,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2778
2778
|
}, z.core.$strip>>>;
|
|
2779
2779
|
}, z.core.$strip>, z.ZodObject<{
|
|
2780
2780
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
2781
|
+
body: "body";
|
|
2781
2782
|
chart: "chart";
|
|
2782
2783
|
diagram: "diagram";
|
|
2783
2784
|
table: "table";
|
|
2784
2785
|
image: "image";
|
|
2785
2786
|
notes: "notes";
|
|
2786
|
-
body: "body";
|
|
2787
2787
|
}>>;
|
|
2788
2788
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
2789
2789
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -2916,12 +2916,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2916
2916
|
}, z.core.$strip>>>;
|
|
2917
2917
|
}, z.core.$strip>, z.ZodObject<{
|
|
2918
2918
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
2919
|
+
body: "body";
|
|
2919
2920
|
chart: "chart";
|
|
2920
2921
|
diagram: "diagram";
|
|
2921
2922
|
table: "table";
|
|
2922
2923
|
image: "image";
|
|
2923
2924
|
notes: "notes";
|
|
2924
|
-
body: "body";
|
|
2925
2925
|
}>>;
|
|
2926
2926
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
2927
2927
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -3004,12 +3004,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
3004
3004
|
}, z.core.$strip>>>;
|
|
3005
3005
|
}, z.core.$strip>, z.ZodObject<{
|
|
3006
3006
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
3007
|
+
body: "body";
|
|
3007
3008
|
chart: "chart";
|
|
3008
3009
|
diagram: "diagram";
|
|
3009
3010
|
table: "table";
|
|
3010
3011
|
image: "image";
|
|
3011
3012
|
notes: "notes";
|
|
3012
|
-
body: "body";
|
|
3013
3013
|
}>>;
|
|
3014
3014
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
3015
3015
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -3264,12 +3264,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
3264
3264
|
}, z.core.$strip>, z.ZodObject<{
|
|
3265
3265
|
formula: z.ZodObject<{
|
|
3266
3266
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
3267
|
+
body: "body";
|
|
3267
3268
|
chart: "chart";
|
|
3268
3269
|
diagram: "diagram";
|
|
3269
3270
|
table: "table";
|
|
3270
3271
|
image: "image";
|
|
3271
3272
|
notes: "notes";
|
|
3272
|
-
body: "body";
|
|
3273
3273
|
}>>;
|
|
3274
3274
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
3275
3275
|
transcript: z.ZodOptional<z.ZodObject<{
|
package/dist/codec.d.ts
CHANGED
|
@@ -629,12 +629,12 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
|
|
|
629
629
|
}, z.core.$strip>, z.ZodObject<{
|
|
630
630
|
children: z.ZodArray<z.ZodObject<{
|
|
631
631
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
632
|
+
body: "body";
|
|
632
633
|
chart: "chart";
|
|
633
634
|
diagram: "diagram";
|
|
634
635
|
table: "table";
|
|
635
636
|
image: "image";
|
|
636
637
|
notes: "notes";
|
|
637
|
-
body: "body";
|
|
638
638
|
}>>;
|
|
639
639
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
640
640
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -844,12 +844,12 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
|
|
|
844
844
|
declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
845
845
|
sections: z.ZodArray<z.ZodObject<{
|
|
846
846
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
847
|
+
body: "body";
|
|
847
848
|
chart: "chart";
|
|
848
849
|
diagram: "diagram";
|
|
849
850
|
table: "table";
|
|
850
851
|
image: "image";
|
|
851
852
|
notes: "notes";
|
|
852
|
-
body: "body";
|
|
853
853
|
}>>;
|
|
854
854
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
855
855
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -993,12 +993,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
993
993
|
}, z.core.$strip>, z.ZodObject<{
|
|
994
994
|
slides: z.ZodArray<z.ZodObject<{
|
|
995
995
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
996
|
+
body: "body";
|
|
996
997
|
chart: "chart";
|
|
997
998
|
diagram: "diagram";
|
|
998
999
|
table: "table";
|
|
999
1000
|
image: "image";
|
|
1000
1001
|
notes: "notes";
|
|
1001
|
-
body: "body";
|
|
1002
1002
|
}>>;
|
|
1003
1003
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
1004
1004
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -1026,12 +1026,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
1026
1026
|
shapes: z.ZodArray<z.ZodObject<{
|
|
1027
1027
|
blocks: z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>;
|
|
1028
1028
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
1029
|
+
body: "body";
|
|
1029
1030
|
chart: "chart";
|
|
1030
1031
|
diagram: "diagram";
|
|
1031
1032
|
table: "table";
|
|
1032
1033
|
image: "image";
|
|
1033
1034
|
notes: "notes";
|
|
1034
|
-
body: "body";
|
|
1035
1035
|
}>>;
|
|
1036
1036
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
1037
1037
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -1189,12 +1189,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
1189
1189
|
}, z.core.$strip>, z.ZodObject<{
|
|
1190
1190
|
sheets: z.ZodArray<z.ZodObject<{
|
|
1191
1191
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
1192
|
+
body: "body";
|
|
1192
1193
|
chart: "chart";
|
|
1193
1194
|
diagram: "diagram";
|
|
1194
1195
|
table: "table";
|
|
1195
1196
|
image: "image";
|
|
1196
1197
|
notes: "notes";
|
|
1197
|
-
body: "body";
|
|
1198
1198
|
}>>;
|
|
1199
1199
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
1200
1200
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -1218,12 +1218,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
1218
1218
|
name: z.ZodString;
|
|
1219
1219
|
cells: z.ZodArray<z.ZodObject<{
|
|
1220
1220
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
1221
|
+
body: "body";
|
|
1221
1222
|
chart: "chart";
|
|
1222
1223
|
diagram: "diagram";
|
|
1223
1224
|
table: "table";
|
|
1224
1225
|
image: "image";
|
|
1225
1226
|
notes: "notes";
|
|
1226
|
-
body: "body";
|
|
1227
1227
|
}>>;
|
|
1228
1228
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
1229
1229
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -1298,12 +1298,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
1298
1298
|
}, z.core.$strip>>;
|
|
1299
1299
|
runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1300
1300
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
1301
|
+
body: "body";
|
|
1301
1302
|
chart: "chart";
|
|
1302
1303
|
diagram: "diagram";
|
|
1303
1304
|
table: "table";
|
|
1304
1305
|
image: "image";
|
|
1305
1306
|
notes: "notes";
|
|
1306
|
-
body: "body";
|
|
1307
1307
|
}>>;
|
|
1308
1308
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
1309
1309
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -1597,12 +1597,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
1597
1597
|
}, z.core.$strip>>;
|
|
1598
1598
|
images: z.ZodArray<z.ZodObject<{
|
|
1599
1599
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
1600
|
+
body: "body";
|
|
1600
1601
|
chart: "chart";
|
|
1601
1602
|
diagram: "diagram";
|
|
1602
1603
|
table: "table";
|
|
1603
1604
|
image: "image";
|
|
1604
1605
|
notes: "notes";
|
|
1605
|
-
body: "body";
|
|
1606
1606
|
}>>;
|
|
1607
1607
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
1608
1608
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -1816,9 +1816,9 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
1816
1816
|
endColumn: z.ZodNumber;
|
|
1817
1817
|
}, z.core.$strip>>;
|
|
1818
1818
|
type: z.ZodEnum<{
|
|
1819
|
+
time: "time";
|
|
1819
1820
|
date: "date";
|
|
1820
1821
|
custom: "custom";
|
|
1821
|
-
time: "time";
|
|
1822
1822
|
decimal: "decimal";
|
|
1823
1823
|
list: "list";
|
|
1824
1824
|
whole: "whole";
|
|
@@ -2291,11 +2291,11 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2291
2291
|
stops: z.ZodArray<z.ZodObject<{
|
|
2292
2292
|
value: z.ZodObject<{
|
|
2293
2293
|
type: z.ZodEnum<{
|
|
2294
|
-
formula: "formula";
|
|
2295
2294
|
num: "num";
|
|
2296
|
-
percent: "percent";
|
|
2297
|
-
max: "max";
|
|
2298
2295
|
min: "min";
|
|
2296
|
+
max: "max";
|
|
2297
|
+
formula: "formula";
|
|
2298
|
+
percent: "percent";
|
|
2299
2299
|
percentile: "percentile";
|
|
2300
2300
|
}>;
|
|
2301
2301
|
value: z.ZodOptional<z.ZodString>;
|
|
@@ -2338,22 +2338,22 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2338
2338
|
}, z.core.$strip>, z.ZodObject<{
|
|
2339
2339
|
min: z.ZodObject<{
|
|
2340
2340
|
type: z.ZodEnum<{
|
|
2341
|
-
formula: "formula";
|
|
2342
2341
|
num: "num";
|
|
2343
|
-
percent: "percent";
|
|
2344
|
-
max: "max";
|
|
2345
2342
|
min: "min";
|
|
2343
|
+
max: "max";
|
|
2344
|
+
formula: "formula";
|
|
2345
|
+
percent: "percent";
|
|
2346
2346
|
percentile: "percentile";
|
|
2347
2347
|
}>;
|
|
2348
2348
|
value: z.ZodOptional<z.ZodString>;
|
|
2349
2349
|
}, z.core.$strip>;
|
|
2350
2350
|
max: z.ZodObject<{
|
|
2351
2351
|
type: z.ZodEnum<{
|
|
2352
|
-
formula: "formula";
|
|
2353
2352
|
num: "num";
|
|
2354
|
-
percent: "percent";
|
|
2355
|
-
max: "max";
|
|
2356
2353
|
min: "min";
|
|
2354
|
+
max: "max";
|
|
2355
|
+
formula: "formula";
|
|
2356
|
+
percent: "percent";
|
|
2357
2357
|
percentile: "percentile";
|
|
2358
2358
|
}>;
|
|
2359
2359
|
value: z.ZodOptional<z.ZodString>;
|
|
@@ -2397,11 +2397,11 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2397
2397
|
iconSetType: z.ZodString;
|
|
2398
2398
|
thresholds: z.ZodArray<z.ZodObject<{
|
|
2399
2399
|
type: z.ZodEnum<{
|
|
2400
|
-
formula: "formula";
|
|
2401
2400
|
num: "num";
|
|
2402
|
-
percent: "percent";
|
|
2403
|
-
max: "max";
|
|
2404
2401
|
min: "min";
|
|
2402
|
+
max: "max";
|
|
2403
|
+
formula: "formula";
|
|
2404
|
+
percent: "percent";
|
|
2405
2405
|
percentile: "percentile";
|
|
2406
2406
|
}>;
|
|
2407
2407
|
value: z.ZodOptional<z.ZodString>;
|
|
@@ -2534,12 +2534,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2534
2534
|
}, z.core.$strip>, z.ZodObject<{
|
|
2535
2535
|
pages: z.ZodArray<z.ZodObject<{
|
|
2536
2536
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
2537
|
+
body: "body";
|
|
2537
2538
|
chart: "chart";
|
|
2538
2539
|
diagram: "diagram";
|
|
2539
2540
|
table: "table";
|
|
2540
2541
|
image: "image";
|
|
2541
2542
|
notes: "notes";
|
|
2542
|
-
body: "body";
|
|
2543
2543
|
}>>;
|
|
2544
2544
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
2545
2545
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -2567,12 +2567,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2567
2567
|
shapes: z.ZodArray<z.ZodObject<{
|
|
2568
2568
|
blocks: z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>;
|
|
2569
2569
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
2570
|
+
body: "body";
|
|
2570
2571
|
chart: "chart";
|
|
2571
2572
|
diagram: "diagram";
|
|
2572
2573
|
table: "table";
|
|
2573
2574
|
image: "image";
|
|
2574
2575
|
notes: "notes";
|
|
2575
|
-
body: "body";
|
|
2576
2576
|
}>>;
|
|
2577
2577
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
2578
2578
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -2640,12 +2640,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2640
2640
|
}, z.core.$strip>>;
|
|
2641
2641
|
vectors: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2642
2642
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
2643
|
+
body: "body";
|
|
2643
2644
|
chart: "chart";
|
|
2644
2645
|
diagram: "diagram";
|
|
2645
2646
|
table: "table";
|
|
2646
2647
|
image: "image";
|
|
2647
2648
|
notes: "notes";
|
|
2648
|
-
body: "body";
|
|
2649
2649
|
}>>;
|
|
2650
2650
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
2651
2651
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -2778,12 +2778,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2778
2778
|
}, z.core.$strip>>>;
|
|
2779
2779
|
}, z.core.$strip>, z.ZodObject<{
|
|
2780
2780
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
2781
|
+
body: "body";
|
|
2781
2782
|
chart: "chart";
|
|
2782
2783
|
diagram: "diagram";
|
|
2783
2784
|
table: "table";
|
|
2784
2785
|
image: "image";
|
|
2785
2786
|
notes: "notes";
|
|
2786
|
-
body: "body";
|
|
2787
2787
|
}>>;
|
|
2788
2788
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
2789
2789
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -2916,12 +2916,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
2916
2916
|
}, z.core.$strip>>>;
|
|
2917
2917
|
}, z.core.$strip>, z.ZodObject<{
|
|
2918
2918
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
2919
|
+
body: "body";
|
|
2919
2920
|
chart: "chart";
|
|
2920
2921
|
diagram: "diagram";
|
|
2921
2922
|
table: "table";
|
|
2922
2923
|
image: "image";
|
|
2923
2924
|
notes: "notes";
|
|
2924
|
-
body: "body";
|
|
2925
2925
|
}>>;
|
|
2926
2926
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
2927
2927
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -3004,12 +3004,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
3004
3004
|
}, z.core.$strip>>>;
|
|
3005
3005
|
}, z.core.$strip>, z.ZodObject<{
|
|
3006
3006
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
3007
|
+
body: "body";
|
|
3007
3008
|
chart: "chart";
|
|
3008
3009
|
diagram: "diagram";
|
|
3009
3010
|
table: "table";
|
|
3010
3011
|
image: "image";
|
|
3011
3012
|
notes: "notes";
|
|
3012
|
-
body: "body";
|
|
3013
3013
|
}>>;
|
|
3014
3014
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
3015
3015
|
transcript: z.ZodOptional<z.ZodObject<{
|
|
@@ -3264,12 +3264,12 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
|
|
|
3264
3264
|
}, z.core.$strip>, z.ZodObject<{
|
|
3265
3265
|
formula: z.ZodObject<{
|
|
3266
3266
|
origin: z.ZodOptional<z.ZodEnum<{
|
|
3267
|
+
body: "body";
|
|
3267
3268
|
chart: "chart";
|
|
3268
3269
|
diagram: "diagram";
|
|
3269
3270
|
table: "table";
|
|
3270
3271
|
image: "image";
|
|
3271
3272
|
notes: "notes";
|
|
3272
|
-
body: "body";
|
|
3273
3273
|
}>>;
|
|
3274
3274
|
interpretation: z.ZodOptional<z.ZodObject<{
|
|
3275
3275
|
transcript: z.ZodOptional<z.ZodObject<{
|
package/dist/emit/emit.cjs
CHANGED
|
@@ -219,6 +219,7 @@ function renderTopLevelBlock(block, context) {
|
|
|
219
219
|
return "";
|
|
220
220
|
case "pageBreak": return "";
|
|
221
221
|
}
|
|
222
|
+
return assertNeverRenderableBlock(block);
|
|
222
223
|
}
|
|
223
224
|
function listInfoFor(numId, context) {
|
|
224
225
|
if (numId === void 0) {
|
|
@@ -245,8 +246,8 @@ function listInfoFor(numId, context) {
|
|
|
245
246
|
}
|
|
246
247
|
function stripCheckboxRun(item) {
|
|
247
248
|
const first = item.runs[0];
|
|
248
|
-
const glyphPrefix = first?.text.startsWith(`☒ `) ? `☒ ` : `☐ `;
|
|
249
|
-
if (
|
|
249
|
+
const glyphPrefix = first?.text.startsWith(`☒ `) === true ? `☒ ` : `☐ `;
|
|
250
|
+
if (first?.text.startsWith(glyphPrefix) !== true) return item;
|
|
250
251
|
const strippedText = first.text.slice(glyphPrefix.length);
|
|
251
252
|
const runs = strippedText.length === 0 ? item.runs.slice(1) : [{
|
|
252
253
|
...first,
|
|
@@ -638,5 +639,9 @@ function emitMarkdown(document, options = {}) {
|
|
|
638
639
|
const text = frontMatter === void 0 ? body : `${frontMatter}\n\n${body}`;
|
|
639
640
|
return (options.lineEnding ?? "lf") === "crlf" ? text.replaceAll("\n", "\r\n") : text;
|
|
640
641
|
}
|
|
642
|
+
function assertNeverRenderableBlock(block) {
|
|
643
|
+
throw new Error(`markdown-codec: unhandled renderable block ${JSON.stringify(block)}`);
|
|
644
|
+
}
|
|
641
645
|
//#endregion
|
|
646
|
+
exports.assertNeverRenderableBlock = assertNeverRenderableBlock;
|
|
642
647
|
exports.emitMarkdown = emitMarkdown;
|
package/dist/emit/emit.d.cts
CHANGED
|
@@ -2,5 +2,6 @@ import { WriteMarkdownOptions } from "../options/options.cjs";
|
|
|
2
2
|
import { ContentDocument } from "document-schema.js";
|
|
3
3
|
//#region src/emit/emit.d.ts
|
|
4
4
|
declare function emitMarkdown(document: ContentDocument, options?: WriteMarkdownOptions): string;
|
|
5
|
+
declare function assertNeverRenderableBlock(block: never): never;
|
|
5
6
|
//#endregion
|
|
6
|
-
export { emitMarkdown };
|
|
7
|
+
export { assertNeverRenderableBlock, emitMarkdown };
|
package/dist/emit/emit.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ import { WriteMarkdownOptions } from "../options/options.js";
|
|
|
2
2
|
import { ContentDocument } from "document-schema.js";
|
|
3
3
|
//#region src/emit/emit.d.ts
|
|
4
4
|
declare function emitMarkdown(document: ContentDocument, options?: WriteMarkdownOptions): string;
|
|
5
|
+
declare function assertNeverRenderableBlock(block: never): never;
|
|
5
6
|
//#endregion
|
|
6
|
-
export { emitMarkdown };
|
|
7
|
+
export { assertNeverRenderableBlock, emitMarkdown };
|
package/dist/emit/emit.js
CHANGED
|
@@ -218,6 +218,7 @@ function renderTopLevelBlock(block, context) {
|
|
|
218
218
|
return "";
|
|
219
219
|
case "pageBreak": return "";
|
|
220
220
|
}
|
|
221
|
+
return assertNeverRenderableBlock(block);
|
|
221
222
|
}
|
|
222
223
|
function listInfoFor(numId, context) {
|
|
223
224
|
if (numId === void 0) {
|
|
@@ -244,8 +245,8 @@ function listInfoFor(numId, context) {
|
|
|
244
245
|
}
|
|
245
246
|
function stripCheckboxRun(item) {
|
|
246
247
|
const first = item.runs[0];
|
|
247
|
-
const glyphPrefix = first?.text.startsWith(`☒ `) ? `☒ ` : `☐ `;
|
|
248
|
-
if (
|
|
248
|
+
const glyphPrefix = first?.text.startsWith(`☒ `) === true ? `☒ ` : `☐ `;
|
|
249
|
+
if (first?.text.startsWith(glyphPrefix) !== true) return item;
|
|
249
250
|
const strippedText = first.text.slice(glyphPrefix.length);
|
|
250
251
|
const runs = strippedText.length === 0 ? item.runs.slice(1) : [{
|
|
251
252
|
...first,
|
|
@@ -637,5 +638,8 @@ function emitMarkdown(document, options = {}) {
|
|
|
637
638
|
const text = frontMatter === void 0 ? body : `${frontMatter}\n\n${body}`;
|
|
638
639
|
return (options.lineEnding ?? "lf") === "crlf" ? text.replaceAll("\n", "\r\n") : text;
|
|
639
640
|
}
|
|
641
|
+
function assertNeverRenderableBlock(block) {
|
|
642
|
+
throw new Error(`markdown-codec: unhandled renderable block ${JSON.stringify(block)}`);
|
|
643
|
+
}
|
|
640
644
|
//#endregion
|
|
641
|
-
export { emitMarkdown };
|
|
645
|
+
export { assertNeverRenderableBlock, emitMarkdown };
|
package/dist/emit/table.cjs
CHANGED
|
@@ -14,6 +14,7 @@ function delimiterCell(alignment) {
|
|
|
14
14
|
case "center": return ":---:";
|
|
15
15
|
case "none": return "---";
|
|
16
16
|
}
|
|
17
|
+
return assertNeverAlignment(alignment);
|
|
17
18
|
}
|
|
18
19
|
function escapeUnescapedPipes(text) {
|
|
19
20
|
let out = "";
|
|
@@ -91,5 +92,9 @@ function emitTable(table, context) {
|
|
|
91
92
|
...body.map((row) => `| ${row.cells.map((cell) => renderCellText(cell, context)).join(" | ")} |`)
|
|
92
93
|
].join("\n");
|
|
93
94
|
}
|
|
95
|
+
function assertNeverAlignment(alignment) {
|
|
96
|
+
throw new Error(`markdown-codec: unhandled table alignment ${JSON.stringify(alignment)}`);
|
|
97
|
+
}
|
|
94
98
|
//#endregion
|
|
99
|
+
exports.assertNeverAlignment = assertNeverAlignment;
|
|
95
100
|
exports.emitTable = emitTable;
|
package/dist/emit/table.d.cts
CHANGED
|
@@ -7,5 +7,6 @@ interface TableEmitContext extends InlineEmitContext {
|
|
|
7
7
|
readonly embedImages: boolean;
|
|
8
8
|
}
|
|
9
9
|
declare function emitTable(table: ContentTable, context: TableEmitContext): string;
|
|
10
|
+
declare function assertNeverAlignment(alignment: never): never;
|
|
10
11
|
//#endregion
|
|
11
|
-
export { TableEmitContext, emitTable };
|
|
12
|
+
export { TableEmitContext, assertNeverAlignment, emitTable };
|
package/dist/emit/table.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ interface TableEmitContext extends InlineEmitContext {
|
|
|
7
7
|
readonly embedImages: boolean;
|
|
8
8
|
}
|
|
9
9
|
declare function emitTable(table: ContentTable, context: TableEmitContext): string;
|
|
10
|
+
declare function assertNeverAlignment(alignment: never): never;
|
|
10
11
|
//#endregion
|
|
11
|
-
export { TableEmitContext, emitTable };
|
|
12
|
+
export { TableEmitContext, assertNeverAlignment, emitTable };
|
package/dist/emit/table.js
CHANGED
|
@@ -13,6 +13,7 @@ function delimiterCell(alignment) {
|
|
|
13
13
|
case "center": return ":---:";
|
|
14
14
|
case "none": return "---";
|
|
15
15
|
}
|
|
16
|
+
return assertNeverAlignment(alignment);
|
|
16
17
|
}
|
|
17
18
|
function escapeUnescapedPipes(text) {
|
|
18
19
|
let out = "";
|
|
@@ -90,5 +91,8 @@ function emitTable(table, context) {
|
|
|
90
91
|
...body.map((row) => `| ${row.cells.map((cell) => renderCellText(cell, context)).join(" | ")} |`)
|
|
91
92
|
].join("\n");
|
|
92
93
|
}
|
|
94
|
+
function assertNeverAlignment(alignment) {
|
|
95
|
+
throw new Error(`markdown-codec: unhandled table alignment ${JSON.stringify(alignment)}`);
|
|
96
|
+
}
|
|
93
97
|
//#endregion
|
|
94
|
-
export { emitTable };
|
|
98
|
+
export { assertNeverAlignment, emitTable };
|
package/dist/html/render.cjs
CHANGED
|
@@ -82,6 +82,7 @@ function renderInline(node) {
|
|
|
82
82
|
case "footnoteReference": return escapeHtml(`[^${node.label}]`);
|
|
83
83
|
case "mathInline": return `\\(${escapeHtml(node.literal)}\\)`;
|
|
84
84
|
}
|
|
85
|
+
return assertNeverInlineNode(node);
|
|
85
86
|
}
|
|
86
87
|
function renderInlines(nodes) {
|
|
87
88
|
return nodes.map(renderInline).join("");
|
|
@@ -191,7 +192,11 @@ function renderDocumentToHtml(document) {
|
|
|
191
192
|
renderer.render(document.children, false);
|
|
192
193
|
return renderer.result();
|
|
193
194
|
}
|
|
195
|
+
function assertNeverInlineNode(node) {
|
|
196
|
+
throw new Error(`markdown-codec: unhandled inline node ${JSON.stringify(node)}`);
|
|
197
|
+
}
|
|
194
198
|
//#endregion
|
|
199
|
+
exports.assertNeverInlineNode = assertNeverInlineNode;
|
|
195
200
|
exports.escapeHref = escapeHref;
|
|
196
201
|
exports.escapeHtml = escapeHtml;
|
|
197
202
|
exports.renderDocumentToHtml = renderDocumentToHtml;
|
package/dist/html/render.d.cts
CHANGED
|
@@ -4,5 +4,6 @@ declare function escapeHtml(text: string): string;
|
|
|
4
4
|
declare function escapeHref(href: string): string;
|
|
5
5
|
declare function renderInlines(nodes: readonly MarkdownInlineNode[]): string;
|
|
6
6
|
declare function renderDocumentToHtml(document: MarkdownDocumentNode): string;
|
|
7
|
+
declare function assertNeverInlineNode(node: never): never;
|
|
7
8
|
//#endregion
|
|
8
|
-
export { escapeHref, escapeHtml, renderDocumentToHtml, renderInlines };
|
|
9
|
+
export { assertNeverInlineNode, escapeHref, escapeHtml, renderDocumentToHtml, renderInlines };
|
package/dist/html/render.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ declare function escapeHtml(text: string): string;
|
|
|
4
4
|
declare function escapeHref(href: string): string;
|
|
5
5
|
declare function renderInlines(nodes: readonly MarkdownInlineNode[]): string;
|
|
6
6
|
declare function renderDocumentToHtml(document: MarkdownDocumentNode): string;
|
|
7
|
+
declare function assertNeverInlineNode(node: never): never;
|
|
7
8
|
//#endregion
|
|
8
|
-
export { escapeHref, escapeHtml, renderDocumentToHtml, renderInlines };
|
|
9
|
+
export { assertNeverInlineNode, escapeHref, escapeHtml, renderDocumentToHtml, renderInlines };
|
package/dist/html/render.js
CHANGED
|
@@ -81,6 +81,7 @@ function renderInline(node) {
|
|
|
81
81
|
case "footnoteReference": return escapeHtml(`[^${node.label}]`);
|
|
82
82
|
case "mathInline": return `\\(${escapeHtml(node.literal)}\\)`;
|
|
83
83
|
}
|
|
84
|
+
return assertNeverInlineNode(node);
|
|
84
85
|
}
|
|
85
86
|
function renderInlines(nodes) {
|
|
86
87
|
return nodes.map(renderInline).join("");
|
|
@@ -190,5 +191,8 @@ function renderDocumentToHtml(document) {
|
|
|
190
191
|
renderer.render(document.children, false);
|
|
191
192
|
return renderer.result();
|
|
192
193
|
}
|
|
194
|
+
function assertNeverInlineNode(node) {
|
|
195
|
+
throw new Error(`markdown-codec: unhandled inline node ${JSON.stringify(node)}`);
|
|
196
|
+
}
|
|
193
197
|
//#endregion
|
|
194
|
-
export { escapeHref, escapeHtml, renderDocumentToHtml, renderInlines };
|
|
198
|
+
export { assertNeverInlineNode, escapeHref, escapeHtml, renderDocumentToHtml, renderInlines };
|
package/dist/inline/inline.cjs
CHANGED
|
@@ -478,11 +478,16 @@ function toAstNode(node) {
|
|
|
478
478
|
};
|
|
479
479
|
case "container": return;
|
|
480
480
|
}
|
|
481
|
+
return assertNeverInlineKind(node.kind);
|
|
481
482
|
}
|
|
482
483
|
function parseInlines(content, references, footnotes, options = {}) {
|
|
483
484
|
const root = new InlineParser(content, references, footnotes, options).parse();
|
|
484
485
|
if (options.gfmAutolinks ?? true) require_inline_gfm_autolink.applyGfmAutolinks(root);
|
|
485
486
|
return toChildAstNodes(root);
|
|
486
487
|
}
|
|
488
|
+
function assertNeverInlineKind(kind) {
|
|
489
|
+
throw new Error(`markdown-codec: unhandled inline kind ${JSON.stringify(kind)}`);
|
|
490
|
+
}
|
|
487
491
|
//#endregion
|
|
492
|
+
exports.assertNeverInlineKind = assertNeverInlineKind;
|
|
488
493
|
exports.parseInlines = parseInlines;
|
package/dist/inline/inline.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as parseInlines, t as InlineParseOptions } from "../inline-
|
|
2
|
-
export { InlineParseOptions, parseInlines };
|
|
1
|
+
import { n as assertNeverInlineKind, r as parseInlines, t as InlineParseOptions } from "../inline-B8WNyxnI.cjs";
|
|
2
|
+
export { InlineParseOptions, assertNeverInlineKind, parseInlines };
|
package/dist/inline/inline.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as parseInlines, t as InlineParseOptions } from "../inline-
|
|
2
|
-
export { InlineParseOptions, parseInlines };
|
|
1
|
+
import { n as assertNeverInlineKind, r as parseInlines, t as InlineParseOptions } from "../inline-BBtsaDjb.js";
|
|
2
|
+
export { InlineParseOptions, assertNeverInlineKind, parseInlines };
|
package/dist/inline/inline.js
CHANGED
|
@@ -477,11 +477,15 @@ function toAstNode(node) {
|
|
|
477
477
|
};
|
|
478
478
|
case "container": return;
|
|
479
479
|
}
|
|
480
|
+
return assertNeverInlineKind(node.kind);
|
|
480
481
|
}
|
|
481
482
|
function parseInlines(content, references, footnotes, options = {}) {
|
|
482
483
|
const root = new InlineParser(content, references, footnotes, options).parse();
|
|
483
484
|
if (options.gfmAutolinks ?? true) applyGfmAutolinks(root);
|
|
484
485
|
return toChildAstNodes(root);
|
|
485
486
|
}
|
|
487
|
+
function assertNeverInlineKind(kind) {
|
|
488
|
+
throw new Error(`markdown-codec: unhandled inline kind ${JSON.stringify(kind)}`);
|
|
489
|
+
}
|
|
486
490
|
//#endregion
|
|
487
|
-
export { parseInlines };
|
|
491
|
+
export { assertNeverInlineKind, parseInlines };
|
|
@@ -7,5 +7,6 @@ interface InlineParseOptions {
|
|
|
7
7
|
readonly gfmStrikethrough?: boolean;
|
|
8
8
|
}
|
|
9
9
|
declare function parseInlines(content: string, references: LinkReferenceMap, footnotes: FootnoteLabelSet, options?: InlineParseOptions): MarkdownInlineNode[];
|
|
10
|
+
declare function assertNeverInlineKind(kind: never): never;
|
|
10
11
|
//#endregion
|
|
11
|
-
export {
|
|
12
|
+
export { assertNeverInlineKind as n, parseInlines as r, InlineParseOptions as t };
|
|
@@ -7,5 +7,6 @@ interface InlineParseOptions {
|
|
|
7
7
|
readonly gfmStrikethrough?: boolean;
|
|
8
8
|
}
|
|
9
9
|
declare function parseInlines(content: string, references: LinkReferenceMap, footnotes: FootnoteLabelSet, options?: InlineParseOptions): MarkdownInlineNode[];
|
|
10
|
+
declare function assertNeverInlineKind(kind: never): never;
|
|
10
11
|
//#endregion
|
|
11
|
-
export {
|
|
12
|
+
export { assertNeverInlineKind as n, parseInlines as r, InlineParseOptions as t };
|
package/dist/lower/lower.cjs
CHANGED
|
@@ -318,6 +318,7 @@ function lowerBlock(node, context, contentWidthPt) {
|
|
|
318
318
|
case "tableRow":
|
|
319
319
|
case "tableCell": return [];
|
|
320
320
|
}
|
|
321
|
+
return assertNeverMarkdownBlock(node);
|
|
321
322
|
}
|
|
322
323
|
function lowerParsedMarkdown(parsed, options = {}, metadata = {}) {
|
|
323
324
|
const sink = options.sink ?? require_diagnostics_diagnostics.NOOP_MARKDOWN_DIAGNOSTIC_SINK;
|
|
@@ -378,7 +379,11 @@ function lowerMarkdownDetailed(source, options = {}) {
|
|
|
378
379
|
function lowerMarkdown(source, options = {}) {
|
|
379
380
|
return lowerMarkdownDetailed(source, options).document;
|
|
380
381
|
}
|
|
382
|
+
function assertNeverMarkdownBlock(node) {
|
|
383
|
+
throw new Error(`markdown-codec: unhandled markdown block ${JSON.stringify(node)}`);
|
|
384
|
+
}
|
|
381
385
|
//#endregion
|
|
386
|
+
exports.assertNeverMarkdownBlock = assertNeverMarkdownBlock;
|
|
382
387
|
exports.lowerMarkdown = lowerMarkdown;
|
|
383
388
|
exports.lowerMarkdownDetailed = lowerMarkdownDetailed;
|
|
384
389
|
exports.lowerParsedMarkdown = lowerParsedMarkdown;
|
package/dist/lower/lower.d.cts
CHANGED
|
@@ -11,5 +11,6 @@ interface LoweredMarkdownDetail {
|
|
|
11
11
|
}
|
|
12
12
|
declare function lowerMarkdownDetailed(source: string, options?: ReadMarkdownOptions): LoweredMarkdownDetail;
|
|
13
13
|
declare function lowerMarkdown(source: string, options?: ReadMarkdownOptions): ContentDocument;
|
|
14
|
+
declare function assertNeverMarkdownBlock(node: never): never;
|
|
14
15
|
//#endregion
|
|
15
|
-
export { LoweredMarkdownDetail, lowerMarkdown, lowerMarkdownDetailed, lowerParsedMarkdown };
|
|
16
|
+
export { LoweredMarkdownDetail, assertNeverMarkdownBlock, lowerMarkdown, lowerMarkdownDetailed, lowerParsedMarkdown };
|
package/dist/lower/lower.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ interface LoweredMarkdownDetail {
|
|
|
11
11
|
}
|
|
12
12
|
declare function lowerMarkdownDetailed(source: string, options?: ReadMarkdownOptions): LoweredMarkdownDetail;
|
|
13
13
|
declare function lowerMarkdown(source: string, options?: ReadMarkdownOptions): ContentDocument;
|
|
14
|
+
declare function assertNeverMarkdownBlock(node: never): never;
|
|
14
15
|
//#endregion
|
|
15
|
-
export { LoweredMarkdownDetail, lowerMarkdown, lowerMarkdownDetailed, lowerParsedMarkdown };
|
|
16
|
+
export { LoweredMarkdownDetail, assertNeverMarkdownBlock, lowerMarkdown, lowerMarkdownDetailed, lowerParsedMarkdown };
|
package/dist/lower/lower.js
CHANGED
|
@@ -317,6 +317,7 @@ function lowerBlock(node, context, contentWidthPt) {
|
|
|
317
317
|
case "tableRow":
|
|
318
318
|
case "tableCell": return [];
|
|
319
319
|
}
|
|
320
|
+
return assertNeverMarkdownBlock(node);
|
|
320
321
|
}
|
|
321
322
|
function lowerParsedMarkdown(parsed, options = {}, metadata = {}) {
|
|
322
323
|
const sink = options.sink ?? NOOP_MARKDOWN_DIAGNOSTIC_SINK;
|
|
@@ -377,5 +378,8 @@ function lowerMarkdownDetailed(source, options = {}) {
|
|
|
377
378
|
function lowerMarkdown(source, options = {}) {
|
|
378
379
|
return lowerMarkdownDetailed(source, options).document;
|
|
379
380
|
}
|
|
381
|
+
function assertNeverMarkdownBlock(node) {
|
|
382
|
+
throw new Error(`markdown-codec: unhandled markdown block ${JSON.stringify(node)}`);
|
|
383
|
+
}
|
|
380
384
|
//#endregion
|
|
381
|
-
export { lowerMarkdown, lowerMarkdownDetailed, lowerParsedMarkdown };
|
|
385
|
+
export { assertNeverMarkdownBlock, lowerMarkdown, lowerMarkdownDetailed, lowerParsedMarkdown };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mrkdwn.js",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.9",
|
|
4
4
|
"description": "Hand-written CommonMark+GFM <-> DocumentTree codec, built on document-schema.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"license": "MIT",
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"byte-codec": "2.0.1",
|
|
60
|
-
"document-schema.js": "7.15.
|
|
60
|
+
"document-schema.js": "7.15.3",
|
|
61
61
|
"zod": "4.4.3"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|