mrkdwn.js 8.0.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/block/block.d.cts +1 -1
- package/dist/block/block.d.ts +1 -1
- package/dist/block/definitions.d.cts +1 -1
- package/dist/block/definitions.d.ts +1 -1
- package/dist/diagnostics/diagnostics.cjs +10 -0
- package/dist/diagnostics/diagnostics.d.cts +2 -2
- package/dist/diagnostics/diagnostics.d.ts +2 -2
- package/dist/diagnostics/diagnostics.js +10 -1
- package/dist/{diagnostics-CjfBoW4K.d.cts → diagnostics-Dzg9Nl9H.d.cts} +6 -1
- package/dist/{diagnostics-CjfBoW4K.d.ts → diagnostics-Dzg9Nl9H.d.ts} +6 -1
- package/dist/emit/html-table.cjs +9 -0
- package/dist/emit/html-table.d.cts +5 -1
- package/dist/emit/html-table.d.ts +5 -1
- package/dist/emit/html-table.js +11 -3
- package/dist/emit/inline.d.cts +1 -1
- package/dist/emit/inline.d.ts +1 -1
- package/dist/emit/table.cjs +1 -0
- package/dist/emit/table.d.cts +2 -2
- package/dist/emit/table.d.ts +2 -2
- package/dist/emit/table.js +2 -1
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{inline-DCIKQ83j.d.cts → inline-C2130eAp.d.cts} +1 -1
- package/dist/{inline-INoDAG37.d.ts → inline-DwGatpGm.d.ts} +1 -1
- package/dist/lower/front-matter.d.cts +1 -1
- package/dist/lower/front-matter.d.ts +1 -1
- package/dist/lower/inline.d.cts +1 -1
- package/dist/lower/inline.d.ts +1 -1
- package/dist/options/options.d.cts +1 -1
- package/dist/options/options.d.ts +1 -1
- package/dist/read.d.cts +1 -1
- package/dist/read.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -229,7 +229,7 @@ Emission is the inverse and validates first: a section's markers must pair as ba
|
|
|
229
229
|
|
|
230
230
|
## HTML-table fallback
|
|
231
231
|
|
|
232
|
-
GFM's own pipe-table syntax (github.github.com/gfm, "Tables (extension)") holds inline content only — no cell can carry `colSpan`/`rowSpan`/a background, and no cell can hold a block that isn't inlinable (a nested table, most notably). `writeMarkdownContent` detects this per table (`tableNeedsHtmlFallback`, `src/emit/html-table.ts`): the moment ANY cell needs one of these, the WHOLE table renders as a raw HTML `<table>` block instead of the plain `| a | b |` writer — GFM's own cell grammar cannot mix an HTML sub-block into one cell of an otherwise pipe-syntax table, so a partial, per-cell fallback is not an option. A raw HTML `<table>` block is legal CommonMark regardless (spec 0.31.2, "HTML blocks" start condition 6 names `table` directly — <https://spec.commonmark.org/0.31.2/#html-blocks>). A table with none of these needs still emits the existing, human-readable pipe syntax, unaffected.
|
|
232
|
+
GFM's own pipe-table syntax (github.github.com/gfm, "Tables (extension)") holds inline content only — no cell can carry `colSpan`/`rowSpan`/a background, and no cell can hold a block that isn't inlinable (a nested table, most notably). `writeMarkdownContent` detects this per table (`tableNeedsHtmlFallback`, `src/emit/html-table.ts`): the moment ANY cell needs one of these, the WHOLE table renders as a raw HTML `<table>` block instead of the plain `| a | b |` writer — GFM's own cell grammar cannot mix an HTML sub-block into one cell of an otherwise pipe-syntax table, so a partial, per-cell fallback is not an option. A raw HTML `<table>` block is legal CommonMark regardless (spec 0.31.2, "HTML blocks" start condition 6 names `table` directly — <https://spec.commonmark.org/0.31.2/#html-blocks>). A table with none of these needs still emits the existing, human-readable pipe syntax, unaffected. Either way a table must obey the grid rule (document-schema.js's `findTableGridFault`: no blocks or span on a covered position, rows of one length, no region running past the grid or into another) or `writeMarkdownContent` throws `MarkdownTableGridFaultError`, since neither a pipe row nor an HTML row has a cell for a covered position's content.
|
|
233
233
|
|
|
234
234
|
`readMarkdownContent`/`readMarkdown` recognise this same shape on the way back in (`parseHtmlTable`, `src/html/html-table.ts`) — the one exception to this package's own "raw HTML is never parsed as markup" rule (see the raw-HTML gotcha above and `src/html/html.ts`'s own top comment): a block-level HTML that is, in full, one well-formed `<table>` lowers straight to a real `ContentTable`, so a table written through this fallback reads back as an equal (or equivalent) `ContentTable` rather than degrading to opaque preserved text. This recognition is gated on GFM's table extension being enabled (`gfmTables`, default `true`) exactly the way plain pipe-table promotion already is — with it disabled, a `<table>` block stays exactly the opaque raw HTML it always was, since a `ContentTable` is a GFM-table-extension construct either way it is spelled in the source.
|
|
235
235
|
|
package/dist/block/block.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as MarkdownDocumentNode } from "../ast-CNfTgS0N.cjs";
|
|
2
2
|
import { r as FootnoteLabelSet } from "../footnote-CKk4JbLk.cjs";
|
|
3
|
-
import { i as MarkdownDiagnosticSink } from "../diagnostics-
|
|
3
|
+
import { i as MarkdownDiagnosticSink } from "../diagnostics-Dzg9Nl9H.cjs";
|
|
4
4
|
import { LinkReferenceMap } from "../inline/link.cjs";
|
|
5
5
|
import { t as InlineParseOptions } from "../inline-CnO86zMw.cjs";
|
|
6
6
|
//#region src/block/block.d.ts
|
package/dist/block/block.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as MarkdownDocumentNode } from "../ast-CNfTgS0N.js";
|
|
2
2
|
import { r as FootnoteLabelSet } from "../footnote-CKk4JbLk.js";
|
|
3
|
-
import { i as MarkdownDiagnosticSink } from "../diagnostics-
|
|
3
|
+
import { i as MarkdownDiagnosticSink } from "../diagnostics-Dzg9Nl9H.js";
|
|
4
4
|
import { LinkReferenceMap } from "../inline/link.js";
|
|
5
5
|
import { t as InlineParseOptions } from "../inline-DItZ-VVw.js";
|
|
6
6
|
//#region src/block/block.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as MarkdownDiagnosticSink } from "../diagnostics-
|
|
1
|
+
import { i as MarkdownDiagnosticSink } from "../diagnostics-Dzg9Nl9H.cjs";
|
|
2
2
|
import { LinkReferenceDefinition } from "../inline/link.cjs";
|
|
3
3
|
//#region src/block/definitions.d.ts
|
|
4
4
|
declare function extractDefinitions(content: string, references: Map<string, LinkReferenceDefinition>, sink?: MarkdownDiagnosticSink, startLine?: number): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as MarkdownDiagnosticSink } from "../diagnostics-
|
|
1
|
+
import { i as MarkdownDiagnosticSink } from "../diagnostics-Dzg9Nl9H.js";
|
|
2
2
|
import { LinkReferenceDefinition } from "../inline/link.js";
|
|
3
3
|
//#region src/block/definitions.d.ts
|
|
4
4
|
declare function extractDefinitions(content: string, references: Map<string, LinkReferenceDefinition>, sink?: MarkdownDiagnosticSink, startLine?: number): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let document_schema_js = require("document-schema.js");
|
|
2
3
|
//#region src/diagnostics/diagnostics.ts
|
|
3
4
|
const NOOP_MARKDOWN_DIAGNOSTIC_SINK = () => {};
|
|
4
5
|
const MarkdownDiagnosticCodes = {
|
|
@@ -83,6 +84,14 @@ var MarkdownUnbalancedConstructMarkersError = class extends MarkdownWriteError {
|
|
|
83
84
|
this.blockIndex = blockIndex;
|
|
84
85
|
}
|
|
85
86
|
};
|
|
87
|
+
var MarkdownTableGridFaultError = class extends MarkdownWriteError {
|
|
88
|
+
fault;
|
|
89
|
+
constructor(fault) {
|
|
90
|
+
super("md/table-grid-fault", `a table breaks the grid rule: ${(0, document_schema_js.describeTableGridFault)(fault)}`);
|
|
91
|
+
this.name = "MarkdownTableGridFaultError";
|
|
92
|
+
this.fault = fault;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
86
95
|
var MarkdownInvalidRunConstructExtentError = class extends MarkdownWriteError {
|
|
87
96
|
faultKind;
|
|
88
97
|
entryIndex;
|
|
@@ -116,6 +125,7 @@ exports.MarkdownInvalidUtf8Error = MarkdownInvalidUtf8Error;
|
|
|
116
125
|
exports.MarkdownNestingLimitExceededError = MarkdownNestingLimitExceededError;
|
|
117
126
|
exports.MarkdownPackageFlattenError = MarkdownPackageFlattenError;
|
|
118
127
|
exports.MarkdownParseError = MarkdownParseError;
|
|
128
|
+
exports.MarkdownTableGridFaultError = MarkdownTableGridFaultError;
|
|
119
129
|
exports.MarkdownUnbalancedConstructMarkersError = MarkdownUnbalancedConstructMarkersError;
|
|
120
130
|
exports.MarkdownUnsupportedDocumentKindError = MarkdownUnsupportedDocumentKindError;
|
|
121
131
|
exports.MarkdownWriteError = MarkdownWriteError;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MarkdownInputTooLargeError, c as MarkdownNestingLimitExceededError, d as
|
|
2
|
-
export { MarkdownDiagnostic, MarkdownDiagnosticCodes, MarkdownDiagnosticSeverity, MarkdownDiagnosticSink, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, MarkdownNestingLimitExceededError, MarkdownPackageFlattenError, MarkdownParseError, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK };
|
|
1
|
+
import { a as MarkdownInputTooLargeError, c as MarkdownNestingLimitExceededError, d as MarkdownTableGridFaultError, f as MarkdownUnbalancedConstructMarkersError, h as NOOP_MARKDOWN_DIAGNOSTIC_SINK, i as MarkdownDiagnosticSink, l as MarkdownPackageFlattenError, m as MarkdownWriteError, n as MarkdownDiagnosticCodes, o as MarkdownInvalidRunConstructExtentError, p as MarkdownUnsupportedDocumentKindError, r as MarkdownDiagnosticSeverity, s as MarkdownInvalidUtf8Error, t as MarkdownDiagnostic, u as MarkdownParseError } from "../diagnostics-Dzg9Nl9H.cjs";
|
|
2
|
+
export { MarkdownDiagnostic, MarkdownDiagnosticCodes, MarkdownDiagnosticSeverity, MarkdownDiagnosticSink, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, MarkdownNestingLimitExceededError, MarkdownPackageFlattenError, MarkdownParseError, MarkdownTableGridFaultError, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MarkdownInputTooLargeError, c as MarkdownNestingLimitExceededError, d as
|
|
2
|
-
export { MarkdownDiagnostic, MarkdownDiagnosticCodes, MarkdownDiagnosticSeverity, MarkdownDiagnosticSink, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, MarkdownNestingLimitExceededError, MarkdownPackageFlattenError, MarkdownParseError, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK };
|
|
1
|
+
import { a as MarkdownInputTooLargeError, c as MarkdownNestingLimitExceededError, d as MarkdownTableGridFaultError, f as MarkdownUnbalancedConstructMarkersError, h as NOOP_MARKDOWN_DIAGNOSTIC_SINK, i as MarkdownDiagnosticSink, l as MarkdownPackageFlattenError, m as MarkdownWriteError, n as MarkdownDiagnosticCodes, o as MarkdownInvalidRunConstructExtentError, p as MarkdownUnsupportedDocumentKindError, r as MarkdownDiagnosticSeverity, s as MarkdownInvalidUtf8Error, t as MarkdownDiagnostic, u as MarkdownParseError } from "../diagnostics-Dzg9Nl9H.js";
|
|
2
|
+
export { MarkdownDiagnostic, MarkdownDiagnosticCodes, MarkdownDiagnosticSeverity, MarkdownDiagnosticSink, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, MarkdownNestingLimitExceededError, MarkdownPackageFlattenError, MarkdownParseError, MarkdownTableGridFaultError, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { describeTableGridFault } from "document-schema.js";
|
|
1
2
|
//#region src/diagnostics/diagnostics.ts
|
|
2
3
|
const NOOP_MARKDOWN_DIAGNOSTIC_SINK = () => {};
|
|
3
4
|
const MarkdownDiagnosticCodes = {
|
|
@@ -82,6 +83,14 @@ var MarkdownUnbalancedConstructMarkersError = class extends MarkdownWriteError {
|
|
|
82
83
|
this.blockIndex = blockIndex;
|
|
83
84
|
}
|
|
84
85
|
};
|
|
86
|
+
var MarkdownTableGridFaultError = class extends MarkdownWriteError {
|
|
87
|
+
fault;
|
|
88
|
+
constructor(fault) {
|
|
89
|
+
super("md/table-grid-fault", `a table breaks the grid rule: ${describeTableGridFault(fault)}`);
|
|
90
|
+
this.name = "MarkdownTableGridFaultError";
|
|
91
|
+
this.fault = fault;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
85
94
|
var MarkdownInvalidRunConstructExtentError = class extends MarkdownWriteError {
|
|
86
95
|
faultKind;
|
|
87
96
|
entryIndex;
|
|
@@ -108,4 +117,4 @@ var MarkdownPackageFlattenError = class extends MarkdownWriteError {
|
|
|
108
117
|
}
|
|
109
118
|
};
|
|
110
119
|
//#endregion
|
|
111
|
-
export { MarkdownDiagnosticCodes, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, MarkdownNestingLimitExceededError, MarkdownPackageFlattenError, MarkdownParseError, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK };
|
|
120
|
+
export { MarkdownDiagnosticCodes, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, MarkdownNestingLimitExceededError, MarkdownPackageFlattenError, MarkdownParseError, MarkdownTableGridFaultError, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TableGridFault } from "document-schema.js";
|
|
1
2
|
//#region src/diagnostics/diagnostics.d.ts
|
|
2
3
|
type MarkdownDiagnosticSeverity = "info" | "warning";
|
|
3
4
|
interface MarkdownDiagnostic {
|
|
@@ -65,6 +66,10 @@ declare class MarkdownUnbalancedConstructMarkersError extends MarkdownWriteError
|
|
|
65
66
|
readonly blockIndex: number;
|
|
66
67
|
constructor(imbalanceKind: "unmatchedEnd" | "unclosedStart", blockIndex: number);
|
|
67
68
|
}
|
|
69
|
+
declare class MarkdownTableGridFaultError extends MarkdownWriteError {
|
|
70
|
+
readonly fault: TableGridFault;
|
|
71
|
+
constructor(fault: TableGridFault);
|
|
72
|
+
}
|
|
68
73
|
declare class MarkdownInvalidRunConstructExtentError extends MarkdownWriteError {
|
|
69
74
|
readonly faultKind: "invertedRange" | "beyondRuns";
|
|
70
75
|
readonly entryIndex: number;
|
|
@@ -78,4 +83,4 @@ declare class MarkdownPackageFlattenError extends MarkdownWriteError {
|
|
|
78
83
|
constructor(cause: unknown);
|
|
79
84
|
}
|
|
80
85
|
//#endregion
|
|
81
|
-
export { MarkdownInputTooLargeError as a, MarkdownNestingLimitExceededError as c,
|
|
86
|
+
export { MarkdownInputTooLargeError as a, MarkdownNestingLimitExceededError as c, MarkdownTableGridFaultError as d, MarkdownUnbalancedConstructMarkersError as f, NOOP_MARKDOWN_DIAGNOSTIC_SINK as h, MarkdownDiagnosticSink as i, MarkdownPackageFlattenError as l, MarkdownWriteError as m, MarkdownDiagnosticCodes as n, MarkdownInvalidRunConstructExtentError as o, MarkdownUnsupportedDocumentKindError as p, MarkdownDiagnosticSeverity as r, MarkdownInvalidUtf8Error as s, MarkdownDiagnostic as t, MarkdownParseError as u };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TableGridFault } from "document-schema.js";
|
|
1
2
|
//#region src/diagnostics/diagnostics.d.ts
|
|
2
3
|
type MarkdownDiagnosticSeverity = "info" | "warning";
|
|
3
4
|
interface MarkdownDiagnostic {
|
|
@@ -65,6 +66,10 @@ declare class MarkdownUnbalancedConstructMarkersError extends MarkdownWriteError
|
|
|
65
66
|
readonly blockIndex: number;
|
|
66
67
|
constructor(imbalanceKind: "unmatchedEnd" | "unclosedStart", blockIndex: number);
|
|
67
68
|
}
|
|
69
|
+
declare class MarkdownTableGridFaultError extends MarkdownWriteError {
|
|
70
|
+
readonly fault: TableGridFault;
|
|
71
|
+
constructor(fault: TableGridFault);
|
|
72
|
+
}
|
|
68
73
|
declare class MarkdownInvalidRunConstructExtentError extends MarkdownWriteError {
|
|
69
74
|
readonly faultKind: "invertedRange" | "beyondRuns";
|
|
70
75
|
readonly entryIndex: number;
|
|
@@ -78,4 +83,4 @@ declare class MarkdownPackageFlattenError extends MarkdownWriteError {
|
|
|
78
83
|
constructor(cause: unknown);
|
|
79
84
|
}
|
|
80
85
|
//#endregion
|
|
81
|
-
export { MarkdownInputTooLargeError as a, MarkdownNestingLimitExceededError as c,
|
|
86
|
+
export { MarkdownInputTooLargeError as a, MarkdownNestingLimitExceededError as c, MarkdownTableGridFaultError as d, MarkdownUnbalancedConstructMarkersError as f, NOOP_MARKDOWN_DIAGNOSTIC_SINK as h, MarkdownDiagnosticSink as i, MarkdownPackageFlattenError as l, MarkdownWriteError as m, MarkdownDiagnosticCodes as n, MarkdownInvalidRunConstructExtentError as o, MarkdownUnsupportedDocumentKindError as p, MarkdownDiagnosticSeverity as r, MarkdownInvalidUtf8Error as s, MarkdownDiagnostic as t, MarkdownParseError as u };
|
package/dist/emit/html-table.cjs
CHANGED
|
@@ -91,7 +91,15 @@ function emitCellTag(cell, isHeader, context) {
|
|
|
91
91
|
if (styleParts.length > 0) attrs.push(`style="${escapeHtmlAttribute(styleParts.join(";"))}"`);
|
|
92
92
|
return `<${tag}${attrs.length > 0 ? ` ${attrs.join(" ")}` : ""}>${emitCellHtml(cell, context)}</${tag}>`;
|
|
93
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Throws MarkdownTableGridFaultError when `table` breaks the grid rule. Both table renderers run it before writing anything: a pipe row and an HTML row alike state one cell per anchor, so a table whose covered positions hold content or whose rows disagree about the grid has no faithful rendering in either.
|
|
96
|
+
*/
|
|
97
|
+
function assertTableObeysGridRule(table) {
|
|
98
|
+
const fault = (0, document_schema_js.findTableGridFault)(table);
|
|
99
|
+
if (fault !== void 0) throw new require_diagnostics_diagnostics.MarkdownTableGridFaultError(fault);
|
|
100
|
+
}
|
|
94
101
|
function emitHtmlTable(table, context) {
|
|
102
|
+
assertTableObeysGridRule(table);
|
|
95
103
|
return [
|
|
96
104
|
"<table>",
|
|
97
105
|
...(0, document_schema_js.walkTableGrid)(table).map((positions, rowIndex) => {
|
|
@@ -101,5 +109,6 @@ function emitHtmlTable(table, context) {
|
|
|
101
109
|
].join("\n");
|
|
102
110
|
}
|
|
103
111
|
//#endregion
|
|
112
|
+
exports.assertTableObeysGridRule = assertTableObeysGridRule;
|
|
104
113
|
exports.emitHtmlTable = emitHtmlTable;
|
|
105
114
|
exports.tableNeedsHtmlFallback = tableNeedsHtmlFallback;
|
|
@@ -2,6 +2,10 @@ import { TableEmitContext } from "./table.cjs";
|
|
|
2
2
|
import { ContentTable } from "document-schema.js";
|
|
3
3
|
//#region src/emit/html-table.d.ts
|
|
4
4
|
declare function tableNeedsHtmlFallback(table: ContentTable): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Throws MarkdownTableGridFaultError when `table` breaks the grid rule. Both table renderers run it before writing anything: a pipe row and an HTML row alike state one cell per anchor, so a table whose covered positions hold content or whose rows disagree about the grid has no faithful rendering in either.
|
|
7
|
+
*/
|
|
8
|
+
declare function assertTableObeysGridRule(table: ContentTable): void;
|
|
5
9
|
declare function emitHtmlTable(table: ContentTable, context: TableEmitContext): string;
|
|
6
10
|
//#endregion
|
|
7
|
-
export { emitHtmlTable, tableNeedsHtmlFallback };
|
|
11
|
+
export { assertTableObeysGridRule, emitHtmlTable, tableNeedsHtmlFallback };
|
|
@@ -2,6 +2,10 @@ import { TableEmitContext } from "./table.js";
|
|
|
2
2
|
import { ContentTable } from "document-schema.js";
|
|
3
3
|
//#region src/emit/html-table.d.ts
|
|
4
4
|
declare function tableNeedsHtmlFallback(table: ContentTable): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Throws MarkdownTableGridFaultError when `table` breaks the grid rule. Both table renderers run it before writing anything: a pipe row and an HTML row alike state one cell per anchor, so a table whose covered positions hold content or whose rows disagree about the grid has no faithful rendering in either.
|
|
7
|
+
*/
|
|
8
|
+
declare function assertTableObeysGridRule(table: ContentTable): void;
|
|
5
9
|
declare function emitHtmlTable(table: ContentTable, context: TableEmitContext): string;
|
|
6
10
|
//#endregion
|
|
7
|
-
export { emitHtmlTable, tableNeedsHtmlFallback };
|
|
11
|
+
export { assertTableObeysGridRule, emitHtmlTable, tableNeedsHtmlFallback };
|
package/dist/emit/html-table.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MarkdownDiagnosticCodes } from "../diagnostics/diagnostics.js";
|
|
1
|
+
import { MarkdownDiagnosticCodes, MarkdownTableGridFaultError } from "../diagnostics/diagnostics.js";
|
|
2
2
|
import "../shared/style-constants.js";
|
|
3
|
-
import { colorToRgbHex, walkTableGrid } from "document-schema.js";
|
|
3
|
+
import { colorToRgbHex, findTableGridFault, walkTableGrid } from "document-schema.js";
|
|
4
4
|
//#region src/emit/html-table.ts
|
|
5
5
|
function escapeHtmlText(text) {
|
|
6
6
|
return text.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
@@ -90,7 +90,15 @@ function emitCellTag(cell, isHeader, context) {
|
|
|
90
90
|
if (styleParts.length > 0) attrs.push(`style="${escapeHtmlAttribute(styleParts.join(";"))}"`);
|
|
91
91
|
return `<${tag}${attrs.length > 0 ? ` ${attrs.join(" ")}` : ""}>${emitCellHtml(cell, context)}</${tag}>`;
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Throws MarkdownTableGridFaultError when `table` breaks the grid rule. Both table renderers run it before writing anything: a pipe row and an HTML row alike state one cell per anchor, so a table whose covered positions hold content or whose rows disagree about the grid has no faithful rendering in either.
|
|
95
|
+
*/
|
|
96
|
+
function assertTableObeysGridRule(table) {
|
|
97
|
+
const fault = findTableGridFault(table);
|
|
98
|
+
if (fault !== void 0) throw new MarkdownTableGridFaultError(fault);
|
|
99
|
+
}
|
|
93
100
|
function emitHtmlTable(table, context) {
|
|
101
|
+
assertTableObeysGridRule(table);
|
|
94
102
|
return [
|
|
95
103
|
"<table>",
|
|
96
104
|
...walkTableGrid(table).map((positions, rowIndex) => {
|
|
@@ -100,4 +108,4 @@ function emitHtmlTable(table, context) {
|
|
|
100
108
|
].join("\n");
|
|
101
109
|
}
|
|
102
110
|
//#endregion
|
|
103
|
-
export { emitHtmlTable, tableNeedsHtmlFallback };
|
|
111
|
+
export { assertTableObeysGridRule, emitHtmlTable, tableNeedsHtmlFallback };
|
package/dist/emit/inline.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as escapeMarkdownText, i as escapeLinkDestination, n as emitRuns, o as renderLinkTitle, r as emitRunsSingleLine, t as InlineEmitContext } from "../inline-
|
|
1
|
+
import { a as escapeMarkdownText, i as escapeLinkDestination, n as emitRuns, o as renderLinkTitle, r as emitRunsSingleLine, t as InlineEmitContext } from "../inline-C2130eAp.cjs";
|
|
2
2
|
export { InlineEmitContext, emitRuns, emitRunsSingleLine, escapeLinkDestination, escapeMarkdownText, renderLinkTitle };
|
package/dist/emit/inline.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as escapeMarkdownText, i as escapeLinkDestination, n as emitRuns, o as renderLinkTitle, r as emitRunsSingleLine, t as InlineEmitContext } from "../inline-
|
|
1
|
+
import { a as escapeMarkdownText, i as escapeLinkDestination, n as emitRuns, o as renderLinkTitle, r as emitRunsSingleLine, t as InlineEmitContext } from "../inline-DwGatpGm.js";
|
|
2
2
|
export { InlineEmitContext, emitRuns, emitRunsSingleLine, escapeLinkDestination, escapeMarkdownText, renderLinkTitle };
|
package/dist/emit/table.cjs
CHANGED
|
@@ -67,6 +67,7 @@ function emitTable(table, context) {
|
|
|
67
67
|
});
|
|
68
68
|
return require_emit_html_table.emitHtmlTable(table, context);
|
|
69
69
|
}
|
|
70
|
+
require_emit_html_table.assertTableObeysGridRule(table);
|
|
70
71
|
const [header, ...body] = table.rows;
|
|
71
72
|
if (header === void 0) return "";
|
|
72
73
|
const alignments = header.cells.map((cell) => toMarkdownAlignment(cell.blocks[0]?.kind === "paragraph" ? cell.blocks[0].alignment : void 0));
|
package/dist/emit/table.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as MarkdownDiagnosticSink } from "../diagnostics-
|
|
2
|
-
import { t as InlineEmitContext } from "../inline-
|
|
1
|
+
import { i as MarkdownDiagnosticSink } from "../diagnostics-Dzg9Nl9H.cjs";
|
|
2
|
+
import { t as InlineEmitContext } from "../inline-C2130eAp.cjs";
|
|
3
3
|
import { ContentTable } from "document-schema.js";
|
|
4
4
|
//#region src/emit/table.d.ts
|
|
5
5
|
interface TableEmitContext extends InlineEmitContext {
|
package/dist/emit/table.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as MarkdownDiagnosticSink } from "../diagnostics-
|
|
2
|
-
import { t as InlineEmitContext } from "../inline-
|
|
1
|
+
import { i as MarkdownDiagnosticSink } from "../diagnostics-Dzg9Nl9H.js";
|
|
2
|
+
import { t as InlineEmitContext } from "../inline-DwGatpGm.js";
|
|
3
3
|
import { ContentTable } from "document-schema.js";
|
|
4
4
|
//#region src/emit/table.d.ts
|
|
5
5
|
interface TableEmitContext extends InlineEmitContext {
|
package/dist/emit/table.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MarkdownDiagnosticCodes } from "../diagnostics/diagnostics.js";
|
|
2
2
|
import { emitRunsSingleLine } from "./inline.js";
|
|
3
3
|
import { emitImage } from "./image.js";
|
|
4
|
-
import { emitHtmlTable, tableNeedsHtmlFallback } from "./html-table.js";
|
|
4
|
+
import { assertTableObeysGridRule, emitHtmlTable, tableNeedsHtmlFallback } from "./html-table.js";
|
|
5
5
|
//#region src/emit/table.ts
|
|
6
6
|
function toMarkdownAlignment(alignment) {
|
|
7
7
|
return alignment === void 0 || alignment === "justify" ? "none" : alignment;
|
|
@@ -66,6 +66,7 @@ function emitTable(table, context) {
|
|
|
66
66
|
});
|
|
67
67
|
return emitHtmlTable(table, context);
|
|
68
68
|
}
|
|
69
|
+
assertTableObeysGridRule(table);
|
|
69
70
|
const [header, ...body] = table.rows;
|
|
70
71
|
if (header === void 0) return "";
|
|
71
72
|
const alignments = header.cells.map((cell) => toMarkdownAlignment(cell.blocks[0]?.kind === "paragraph" ? cell.blocks[0].alignment : void 0));
|
package/dist/index.cjs
CHANGED
|
@@ -17,6 +17,7 @@ exports.MarkdownInvalidRunConstructExtentError = require_diagnostics_diagnostics
|
|
|
17
17
|
exports.MarkdownInvalidUtf8Error = require_diagnostics_diagnostics.MarkdownInvalidUtf8Error;
|
|
18
18
|
exports.MarkdownNestingLimitExceededError = require_diagnostics_diagnostics.MarkdownNestingLimitExceededError;
|
|
19
19
|
exports.MarkdownParseError = require_diagnostics_diagnostics.MarkdownParseError;
|
|
20
|
+
exports.MarkdownTableGridFaultError = require_diagnostics_diagnostics.MarkdownTableGridFaultError;
|
|
20
21
|
exports.MarkdownUnbalancedConstructMarkersError = require_diagnostics_diagnostics.MarkdownUnbalancedConstructMarkersError;
|
|
21
22
|
exports.MarkdownUnsupportedDocumentKindError = require_diagnostics_diagnostics.MarkdownUnsupportedDocumentKindError;
|
|
22
23
|
exports.MarkdownWriteError = require_diagnostics_diagnostics.MarkdownWriteError;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as MarkdownInputTooLargeError, c as MarkdownNestingLimitExceededError, d as
|
|
1
|
+
import { a as MarkdownInputTooLargeError, c as MarkdownNestingLimitExceededError, d as MarkdownTableGridFaultError, f as MarkdownUnbalancedConstructMarkersError, h as NOOP_MARKDOWN_DIAGNOSTIC_SINK, i as MarkdownDiagnosticSink, m as MarkdownWriteError, n as MarkdownDiagnosticCodes, o as MarkdownInvalidRunConstructExtentError, p as MarkdownUnsupportedDocumentKindError, r as MarkdownDiagnosticSeverity, s as MarkdownInvalidUtf8Error, t as MarkdownDiagnostic, u as MarkdownParseError } from "./diagnostics-Dzg9Nl9H.cjs";
|
|
2
2
|
import { MarkdownBytesSchema, markdownCodec, markdownContentCodec } from "./codec.cjs";
|
|
3
3
|
import { n as MarkdownImageResolver, r as MarkdownResolvedImageBytes, t as MarkdownImageResolveContext } from "./image-B6p0Ovgy.cjs";
|
|
4
4
|
import { MarkdownBulletListMarker, MarkdownCodeFenceChar, MarkdownEmphasisMarker, MarkdownHeadingStyle, MarkdownLineEnding, MarkdownOrderedListDelimiter, MarkdownThematicBreakChar, ReadMarkdownOptions, WriteMarkdownOptions, WriteMarkdownStyleOptions } from "./options/options.cjs";
|
|
@@ -6,4 +6,4 @@ import { ReadMarkdownContentResult, ReadMarkdownResult, readMarkdown, readMarkdo
|
|
|
6
6
|
import { writeMarkdown, writeMarkdownContent } from "./write.cjs";
|
|
7
7
|
import { ListNumIdInfo, ListNumIdMintOptions, NumIdMintState, createNumIdMintState, mintListNumId, mintedListType, parseListNumId } from "./shared/list-id.cjs";
|
|
8
8
|
import { CODE_BLOCK_STYLE_ID, HORIZONTAL_RULE_STYLE_ID, HTML_PREFORMATTED_STYLE_ID, MAX_HEADING_STYLE_LEVEL, MONOSPACE_FONT_FAMILY, QUOTE_INDENT_PT, QUOTE_STYLE_ID, headingStyleId, parseHeadingStyleId } from "./shared/style-constants.cjs";
|
|
9
|
-
export { CODE_BLOCK_STYLE_ID, HORIZONTAL_RULE_STYLE_ID, HTML_PREFORMATTED_STYLE_ID, type ListNumIdInfo, type ListNumIdMintOptions, MAX_HEADING_STYLE_LEVEL, MONOSPACE_FONT_FAMILY, type MarkdownBulletListMarker, MarkdownBytesSchema, type MarkdownCodeFenceChar, type MarkdownDiagnostic, MarkdownDiagnosticCodes, type MarkdownDiagnosticSeverity, type MarkdownDiagnosticSink, type MarkdownEmphasisMarker, type MarkdownHeadingStyle, type MarkdownImageResolveContext, type MarkdownImageResolver, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, type MarkdownLineEnding, MarkdownNestingLimitExceededError, type MarkdownOrderedListDelimiter, MarkdownParseError, type MarkdownResolvedImageBytes, type MarkdownThematicBreakChar, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK, type NumIdMintState, QUOTE_INDENT_PT, QUOTE_STYLE_ID, type ReadMarkdownContentResult, type ReadMarkdownOptions, type ReadMarkdownResult, type WriteMarkdownOptions, type WriteMarkdownStyleOptions, createNumIdMintState, headingStyleId, markdownCodec, markdownContentCodec, mintListNumId, mintedListType, parseHeadingStyleId, parseListNumId, readMarkdown, readMarkdownContent, writeMarkdown, writeMarkdownContent };
|
|
9
|
+
export { CODE_BLOCK_STYLE_ID, HORIZONTAL_RULE_STYLE_ID, HTML_PREFORMATTED_STYLE_ID, type ListNumIdInfo, type ListNumIdMintOptions, MAX_HEADING_STYLE_LEVEL, MONOSPACE_FONT_FAMILY, type MarkdownBulletListMarker, MarkdownBytesSchema, type MarkdownCodeFenceChar, type MarkdownDiagnostic, MarkdownDiagnosticCodes, type MarkdownDiagnosticSeverity, type MarkdownDiagnosticSink, type MarkdownEmphasisMarker, type MarkdownHeadingStyle, type MarkdownImageResolveContext, type MarkdownImageResolver, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, type MarkdownLineEnding, MarkdownNestingLimitExceededError, type MarkdownOrderedListDelimiter, MarkdownParseError, type MarkdownResolvedImageBytes, MarkdownTableGridFaultError, type MarkdownThematicBreakChar, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK, type NumIdMintState, QUOTE_INDENT_PT, QUOTE_STYLE_ID, type ReadMarkdownContentResult, type ReadMarkdownOptions, type ReadMarkdownResult, type WriteMarkdownOptions, type WriteMarkdownStyleOptions, createNumIdMintState, headingStyleId, markdownCodec, markdownContentCodec, mintListNumId, mintedListType, parseHeadingStyleId, parseListNumId, readMarkdown, readMarkdownContent, writeMarkdown, writeMarkdownContent };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as MarkdownInputTooLargeError, c as MarkdownNestingLimitExceededError, d as
|
|
1
|
+
import { a as MarkdownInputTooLargeError, c as MarkdownNestingLimitExceededError, d as MarkdownTableGridFaultError, f as MarkdownUnbalancedConstructMarkersError, h as NOOP_MARKDOWN_DIAGNOSTIC_SINK, i as MarkdownDiagnosticSink, m as MarkdownWriteError, n as MarkdownDiagnosticCodes, o as MarkdownInvalidRunConstructExtentError, p as MarkdownUnsupportedDocumentKindError, r as MarkdownDiagnosticSeverity, s as MarkdownInvalidUtf8Error, t as MarkdownDiagnostic, u as MarkdownParseError } from "./diagnostics-Dzg9Nl9H.js";
|
|
2
2
|
import { MarkdownBytesSchema, markdownCodec, markdownContentCodec } from "./codec.js";
|
|
3
3
|
import { n as MarkdownImageResolver, r as MarkdownResolvedImageBytes, t as MarkdownImageResolveContext } from "./image-gR1vISI0.js";
|
|
4
4
|
import { MarkdownBulletListMarker, MarkdownCodeFenceChar, MarkdownEmphasisMarker, MarkdownHeadingStyle, MarkdownLineEnding, MarkdownOrderedListDelimiter, MarkdownThematicBreakChar, ReadMarkdownOptions, WriteMarkdownOptions, WriteMarkdownStyleOptions } from "./options/options.js";
|
|
@@ -6,4 +6,4 @@ import { ReadMarkdownContentResult, ReadMarkdownResult, readMarkdown, readMarkdo
|
|
|
6
6
|
import { writeMarkdown, writeMarkdownContent } from "./write.js";
|
|
7
7
|
import { ListNumIdInfo, ListNumIdMintOptions, NumIdMintState, createNumIdMintState, mintListNumId, mintedListType, parseListNumId } from "./shared/list-id.js";
|
|
8
8
|
import { CODE_BLOCK_STYLE_ID, HORIZONTAL_RULE_STYLE_ID, HTML_PREFORMATTED_STYLE_ID, MAX_HEADING_STYLE_LEVEL, MONOSPACE_FONT_FAMILY, QUOTE_INDENT_PT, QUOTE_STYLE_ID, headingStyleId, parseHeadingStyleId } from "./shared/style-constants.js";
|
|
9
|
-
export { CODE_BLOCK_STYLE_ID, HORIZONTAL_RULE_STYLE_ID, HTML_PREFORMATTED_STYLE_ID, type ListNumIdInfo, type ListNumIdMintOptions, MAX_HEADING_STYLE_LEVEL, MONOSPACE_FONT_FAMILY, type MarkdownBulletListMarker, MarkdownBytesSchema, type MarkdownCodeFenceChar, type MarkdownDiagnostic, MarkdownDiagnosticCodes, type MarkdownDiagnosticSeverity, type MarkdownDiagnosticSink, type MarkdownEmphasisMarker, type MarkdownHeadingStyle, type MarkdownImageResolveContext, type MarkdownImageResolver, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, type MarkdownLineEnding, MarkdownNestingLimitExceededError, type MarkdownOrderedListDelimiter, MarkdownParseError, type MarkdownResolvedImageBytes, type MarkdownThematicBreakChar, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK, type NumIdMintState, QUOTE_INDENT_PT, QUOTE_STYLE_ID, type ReadMarkdownContentResult, type ReadMarkdownOptions, type ReadMarkdownResult, type WriteMarkdownOptions, type WriteMarkdownStyleOptions, createNumIdMintState, headingStyleId, markdownCodec, markdownContentCodec, mintListNumId, mintedListType, parseHeadingStyleId, parseListNumId, readMarkdown, readMarkdownContent, writeMarkdown, writeMarkdownContent };
|
|
9
|
+
export { CODE_BLOCK_STYLE_ID, HORIZONTAL_RULE_STYLE_ID, HTML_PREFORMATTED_STYLE_ID, type ListNumIdInfo, type ListNumIdMintOptions, MAX_HEADING_STYLE_LEVEL, MONOSPACE_FONT_FAMILY, type MarkdownBulletListMarker, MarkdownBytesSchema, type MarkdownCodeFenceChar, type MarkdownDiagnostic, MarkdownDiagnosticCodes, type MarkdownDiagnosticSeverity, type MarkdownDiagnosticSink, type MarkdownEmphasisMarker, type MarkdownHeadingStyle, type MarkdownImageResolveContext, type MarkdownImageResolver, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, type MarkdownLineEnding, MarkdownNestingLimitExceededError, type MarkdownOrderedListDelimiter, MarkdownParseError, type MarkdownResolvedImageBytes, MarkdownTableGridFaultError, type MarkdownThematicBreakChar, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK, type NumIdMintState, QUOTE_INDENT_PT, QUOTE_STYLE_ID, type ReadMarkdownContentResult, type ReadMarkdownOptions, type ReadMarkdownResult, type WriteMarkdownOptions, type WriteMarkdownStyleOptions, createNumIdMintState, headingStyleId, markdownCodec, markdownContentCodec, mintListNumId, mintedListType, parseHeadingStyleId, parseListNumId, readMarkdown, readMarkdownContent, writeMarkdown, writeMarkdownContent };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MarkdownDiagnosticCodes, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, MarkdownNestingLimitExceededError, MarkdownParseError, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK } from "./diagnostics/diagnostics.js";
|
|
1
|
+
import { MarkdownDiagnosticCodes, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, MarkdownNestingLimitExceededError, MarkdownParseError, MarkdownTableGridFaultError, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK } from "./diagnostics/diagnostics.js";
|
|
2
2
|
import { CODE_BLOCK_STYLE_ID, HORIZONTAL_RULE_STYLE_ID, HTML_PREFORMATTED_STYLE_ID, MAX_HEADING_STYLE_LEVEL, MONOSPACE_FONT_FAMILY, QUOTE_INDENT_PT, QUOTE_STYLE_ID, headingStyleId, parseHeadingStyleId } from "./shared/style-constants.js";
|
|
3
3
|
import { createNumIdMintState, mintListNumId, mintedListType, parseListNumId } from "./shared/list-id.js";
|
|
4
4
|
import { readMarkdown, readMarkdownContent } from "./read.js";
|
|
5
5
|
import { writeMarkdown, writeMarkdownContent } from "./write.js";
|
|
6
6
|
import { MarkdownBytesSchema, markdownCodec, markdownContentCodec } from "./codec.js";
|
|
7
|
-
export { CODE_BLOCK_STYLE_ID, HORIZONTAL_RULE_STYLE_ID, HTML_PREFORMATTED_STYLE_ID, MAX_HEADING_STYLE_LEVEL, MONOSPACE_FONT_FAMILY, MarkdownBytesSchema, MarkdownDiagnosticCodes, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, MarkdownNestingLimitExceededError, MarkdownParseError, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK, QUOTE_INDENT_PT, QUOTE_STYLE_ID, createNumIdMintState, headingStyleId, markdownCodec, markdownContentCodec, mintListNumId, mintedListType, parseHeadingStyleId, parseListNumId, readMarkdown, readMarkdownContent, writeMarkdown, writeMarkdownContent };
|
|
7
|
+
export { CODE_BLOCK_STYLE_ID, HORIZONTAL_RULE_STYLE_ID, HTML_PREFORMATTED_STYLE_ID, MAX_HEADING_STYLE_LEVEL, MONOSPACE_FONT_FAMILY, MarkdownBytesSchema, MarkdownDiagnosticCodes, MarkdownInputTooLargeError, MarkdownInvalidRunConstructExtentError, MarkdownInvalidUtf8Error, MarkdownNestingLimitExceededError, MarkdownParseError, MarkdownTableGridFaultError, MarkdownUnbalancedConstructMarkersError, MarkdownUnsupportedDocumentKindError, MarkdownWriteError, NOOP_MARKDOWN_DIAGNOSTIC_SINK, QUOTE_INDENT_PT, QUOTE_STYLE_ID, createNumIdMintState, headingStyleId, markdownCodec, markdownContentCodec, mintListNumId, mintedListType, parseHeadingStyleId, parseListNumId, readMarkdown, readMarkdownContent, writeMarkdown, writeMarkdownContent };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as MarkdownDiagnosticSink } from "./diagnostics-
|
|
1
|
+
import { i as MarkdownDiagnosticSink } from "./diagnostics-Dzg9Nl9H.cjs";
|
|
2
2
|
import { ContentRun, RunConstructExtent } from "document-schema.js";
|
|
3
3
|
//#region src/emit/inline.d.ts
|
|
4
4
|
interface InlineEmitContext {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as MarkdownDiagnosticSink } from "./diagnostics-
|
|
1
|
+
import { i as MarkdownDiagnosticSink } from "./diagnostics-Dzg9Nl9H.js";
|
|
2
2
|
import { ContentRun, RunConstructExtent } from "document-schema.js";
|
|
3
3
|
//#region src/emit/inline.d.ts
|
|
4
4
|
interface InlineEmitContext {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as MarkdownDiagnosticSink } from "../diagnostics-
|
|
1
|
+
import { i as MarkdownDiagnosticSink } from "../diagnostics-Dzg9Nl9H.cjs";
|
|
2
2
|
import { LayoutMetadata } from "document-schema.js";
|
|
3
3
|
//#region src/lower/front-matter.d.ts
|
|
4
4
|
interface FrontMatterResult {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as MarkdownDiagnosticSink } from "../diagnostics-
|
|
1
|
+
import { i as MarkdownDiagnosticSink } from "../diagnostics-Dzg9Nl9H.js";
|
|
2
2
|
import { LayoutMetadata } from "document-schema.js";
|
|
3
3
|
//#region src/lower/front-matter.d.ts
|
|
4
4
|
interface FrontMatterResult {
|
package/dist/lower/inline.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v as MarkdownInlineNode } from "../ast-CNfTgS0N.cjs";
|
|
2
|
-
import { i as MarkdownDiagnosticSink } from "../diagnostics-
|
|
2
|
+
import { i as MarkdownDiagnosticSink } from "../diagnostics-Dzg9Nl9H.cjs";
|
|
3
3
|
import { ContentRun, RunConstructExtent } from "document-schema.js";
|
|
4
4
|
//#region src/lower/inline.d.ts
|
|
5
5
|
interface InlineLowerContext {
|
package/dist/lower/inline.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v as MarkdownInlineNode } from "../ast-CNfTgS0N.js";
|
|
2
|
-
import { i as MarkdownDiagnosticSink } from "../diagnostics-
|
|
2
|
+
import { i as MarkdownDiagnosticSink } from "../diagnostics-Dzg9Nl9H.js";
|
|
3
3
|
import { ContentRun, RunConstructExtent } from "document-schema.js";
|
|
4
4
|
//#region src/lower/inline.d.ts
|
|
5
5
|
interface InlineLowerContext {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as MarkdownDiagnosticSink } from "../diagnostics-
|
|
1
|
+
import { i as MarkdownDiagnosticSink } from "../diagnostics-Dzg9Nl9H.cjs";
|
|
2
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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as MarkdownDiagnosticSink } from "../diagnostics-
|
|
1
|
+
import { i as MarkdownDiagnosticSink } from "../diagnostics-Dzg9Nl9H.js";
|
|
2
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
|
package/dist/read.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as MarkdownDiagnostic } from "./diagnostics-
|
|
1
|
+
import { t as MarkdownDiagnostic } from "./diagnostics-Dzg9Nl9H.cjs";
|
|
2
2
|
import { ReadMarkdownOptions } from "./options/options.cjs";
|
|
3
3
|
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
4
4
|
//#region src/read.d.ts
|
package/dist/read.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as MarkdownDiagnostic } from "./diagnostics-
|
|
1
|
+
import { t as MarkdownDiagnostic } from "./diagnostics-Dzg9Nl9H.js";
|
|
2
2
|
import { ReadMarkdownOptions } from "./options/options.js";
|
|
3
3
|
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
4
4
|
//#region src/read.d.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mrkdwn.js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Hand-written CommonMark+GFM <-> DocumentTree codec, built on document-schema.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
],
|
|
57
57
|
"license": "MIT",
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"byte-codec": "1.
|
|
60
|
-
"document-schema.js": "7.
|
|
59
|
+
"byte-codec": "1.7.0",
|
|
60
|
+
"document-schema.js": "7.13.0",
|
|
61
61
|
"zod": "4.4.3"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|