Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
fix(open-knowledge): preserve source bytes in parse-error fallbacks (#1724)
Nick Gomez43fa979cdbc9
diff --git a/.changeset/fallback-preserves-source-bytes.md b/.changeset/fallback-preserves-source-bytes.mdnew file mode 100644index 000000000..3ea8755d4--- /dev/null+++ b/.changeset/fallback-preserves-source-bytes.md@@ -0,0 +1,5 @@+---+"@inkeep/open-knowledge-core": patch+---++Parse-error fallback blocks now preserve the source bytes they replace. When a block degrades to a fallback and its position carries only line/column information (no character offsets), the editor now resolves those against the document and shows the block's real content. When the position is genuinely unresolvable (missing, out of bounds, or inverted), the fallback degrades to empty content instead of substituting the mdast node-type name for the block's content — fabricated text that could previously be persisted back over the user's document on interaction (users observed this on an earlier build as a block collapsing to a literal word such as `table` or `list`).diff --git a/packages/app/package.json b/packages/app/package.jsonindex 74d566ac5..a36e6d402 100644--- a/packages/app/package.json+++ b/packages/app/package.json@@ -25,7 +25,7 @@"measure:fuzz": "bash scripts/measure-fuzz.sh","measure:stress": "bash scripts/measure-stress.sh","perf:compare": "bash scripts/perf-compare.sh",- "test:e2e": "playwright test tests/stress/ux-interactions.e2e.ts tests/stress/file-tree-create.e2e.ts tests/stress/create-then-rename-editable.e2e.ts tests/stress/find-replace.e2e.ts tests/stress/editor-tabs.e2e.ts tests/stress/crdt-stress.e2e.ts tests/stress/slash-command.e2e.ts tests/stress/paste-fidelity.e2e.ts tests/stress/fr-7a-disconnect-source-mode.e2e.ts tests/stress/docs-open.e2e.ts tests/stress/asset-embed.e2e.ts tests/stress/asset-embed-advanced.e2e.ts tests/stress/asset-click-dispatch.e2e.ts tests/stress/handoff.e2e.ts tests/stress/multi-agent-presence.e2e.ts tests/stress/editor-mode-persistence.e2e.ts tests/stress/sidebar-search-pill.e2e.ts tests/stress/agent-activity-panel.e2e.ts tests/stress/drop-pipeline-auto-open.e2e.ts tests/stress/command-palette-flicker.e2e.ts tests/stress/cm6-list-hanging-indent.e2e.ts tests/stress/ng7-rapid-nav-coherence.e2e.ts tests/stress/init-load-byte-stable.e2e.ts tests/stress/single-file-ephemeral.e2e.ts tests/stress/reveal-on-activate.e2e.ts tests/stress/selection-indicator.e2e.ts tests/stress/new-file-cross-doc-bleed.e2e.ts tests/stress/editor-mode-flip-cross-doc-bleed.e2e.ts tests/stress/editor-area-viewport-resize.e2e.ts tests/stress/qa-sidebar-responsive.e2e.ts tests/stress/prd-6955-reassertion-repro.e2e.ts tests/stress/prd-6955-reassertion-wedge.e2e.ts",+ "test:e2e": "playwright test tests/stress/ux-interactions.e2e.ts tests/stress/file-tree-create.e2e.ts tests/stress/create-then-rename-editable.e2e.ts tests/stress/find-replace.e2e.ts tests/stress/editor-tabs.e2e.ts tests/stress/crdt-stress.e2e.ts tests/stress/slash-command.e2e.ts tests/stress/paste-fidelity.e2e.ts tests/stress/fr-7a-disconnect-source-mode.e2e.ts tests/stress/docs-open.e2e.ts tests/stress/asset-embed.e2e.ts tests/stress/asset-embed-advanced.e2e.ts tests/stress/asset-click-dispatch.e2e.ts tests/stress/handoff.e2e.ts tests/stress/multi-agent-presence.e2e.ts tests/stress/editor-mode-persistence.e2e.ts tests/stress/sidebar-search-pill.e2e.ts tests/stress/agent-activity-panel.e2e.ts tests/stress/drop-pipeline-auto-open.e2e.ts tests/stress/command-palette-flicker.e2e.ts tests/stress/cm6-list-hanging-indent.e2e.ts tests/stress/ng7-rapid-nav-coherence.e2e.ts tests/stress/init-load-byte-stable.e2e.ts tests/stress/single-file-ephemeral.e2e.ts tests/stress/reveal-on-activate.e2e.ts tests/stress/selection-indicator.e2e.ts tests/stress/new-file-cross-doc-bleed.e2e.ts tests/stress/editor-mode-flip-cross-doc-bleed.e2e.ts tests/stress/editor-area-viewport-resize.e2e.ts tests/stress/qa-sidebar-responsive.e2e.ts tests/stress/prd-6955-reassertion-repro.e2e.ts tests/stress/prd-6955-reassertion-wedge.e2e.ts tests/stress/prd-6914-repro.e2e.ts","test:e2e:install-browsers": "playwright install chromium webkit firefox","test:visual": "playwright test --config playwright.visual.config.ts","test:visual:update": "playwright test --config playwright.visual.config.ts --update-snapshots",diff --git a/packages/app/tests/stress/_fixtures/prd-6914-repro-doc.md b/packages/app/tests/stress/_fixtures/prd-6914-repro-doc.mdnew file mode 100644index 000000000..ef94c274e--- /dev/null+++ b/packages/app/tests/stress/_fixtures/prd-6914-repro-doc.md@@ -0,0 +1,61 @@+---+title: Edmonds — Bottomfish Opener, May 1 2026+description: Opening day for bottomfish in Marine Areas 10 & 9 — fished the Edmonds ferry dock area for lingcod, landed 4 flounder (1 small, 3 medium) instead. Mostly sandy bottom except in front of the ferry and around the pilings.+tags: [ fishing-log, trip, edmonds, saltwater, bottomfish, lingcod, flounder ]+---+# Edmonds — 2026-05-01++> [!NOTE] Trip summary+> Bottomfish **opening day** in Marine Areas 10 & 9. Fished the Edmonds ferry dock area hoping for **lingcod** — instead landed **4 flounder** (1 small, 3 medium). Right structure, wrong target.++## Where & When++- **Date:** 2026-05-01 (bottomfish opener, MA 10 & 9)+- **Water:** Edmonds, around the ferry dock area (Puget Sound). Edmonds sits near the MA 9 / MA 10 boundary.+- **Type:** saltwater+- **Time on water:** \{start}–\{end} — *not recorded*+- **Logged by:** Andrew++## Conditions++- **Weather:** \{sky, air temp, wind} — *not recorded*+- **Water:** \{temp, clarity} — *not recorded*+- **Tide:** \{high/low times & stage} — *not recorded*+- **Moon / barometer:** \{optional} — *not recorded*++## Target & Method++- **Target species:** Lingcod+- **Technique:** Bottom fi but notishing+- **Gear:** \{rod / reel / line} — *not recorded*+- **Bait / lures / jigs:** \{what you threw} — *not recorded*++## Catch++| Species | Count | Size | Kept / Released | Notes |+| --- | --- | --- | --- | --- |+| Flounder | 4 | 1 small, 3 medium | \{K/R} | The small one was rigged as live bait (see below) |+| Lingcod | 0 | — | — | The target species; none landed |++### Live-bait experiment++- Took the **small flounder** and rigged it as **live bait on a circle-hook rig**, hooked **through the gills**.+- **Terminal rig:** sliding-weight (Carolina-style) rig with a **3 oz** sinker attached via a **rubber band** — the rubber band lets the weight break away if it snags the structure, and the sliding setup lets a fish take line without feeling the weight before the circle hook sets.+- Idea: drop a live flatfish down near the hard structure to tempt a lingcod — lings readily eat flounder, so it's a natural bait there.+- {Result of the live-bait drop — any follow / hookup? — *not recorded*}++## Bottom & Structure++- **Substrate:** **Mostly sandy** across the area.+- **Hard structure:** The exceptions were the area **directly in front of the ferry** and **around the ferry pilings** — the bits of harder/structured bottom in an otherwise sandy zone.+- **Read:** Lingcod relate to rock and hard structure, so the ferry frontage and pilings are the spots most worth working for them. The surrounding sand is classic flatfish ground — which lines up with the flounder that came over the rail.++## What Worked / What Didn't++- Flounder were active and willing over the sandy bottom — 4 landed.+- Lingcod were the goal but didn't show; may need to fish tighter to the hard structure (pilings, ferry frontage) — the live-flounder-on-a-circle-hook approach is a good tool to keep trying there.++## Notes for Next Time++list+diff --git a/packages/app/tests/stress/prd-6914-repro.e2e.ts b/packages/app/tests/stress/prd-6914-repro.e2e.tsnew file mode 100644index 000000000..b56fcd901--- /dev/null+++ b/packages/app/tests/stress/prd-6914-repro.e2e.ts@@ -0,0 +1,95 @@+import { readFileSync } from 'node:fs';+import { join } from 'node:path';+import type { Page } from '@playwright/test';+import { expect, test, waitForActiveProviderSynced as waitForProvider } from './_helpers';++async function getSourceText(page: Page): Promise<string> {+ return page.evaluate(() => {+ const provider = (+ window as unknown as {+ __activeProvider?: { document?: { getText: (n: string) => { toString(): string } } };+ }+ ).__activeProvider;+ return provider?.document?.getText('source')?.toString() ?? '';+ });+}++async function awaitSourceQuiescence(page: Page): Promise<string> {+ let prev = '';+ await expect+ .poll(+ async () => {+ const current = await getSourceText(page);+ const stable = current.length > 0 && current === prev;+ prev = current;+ return stable;+ },+ { timeout: 15_000, intervals: [500] },+ )+ .toBe(true);+ return prev;+}++const REPRO_DOC = readFileSync(+ join(import.meta.dirname, '_fixtures/prd-6914-repro-doc.md'),+ 'utf-8',+);++test('PRD-6914: reporter doc — valid table renders without error chrome; passive open preserves source bytes', async ({+ page,+ api,+}) => {+ const docName = `prd-6914-${Date.now()}`;+ await api.seedDocs([{ name: docName, markdown: REPRO_DOC }]);++ await page.goto(`/#/${docName}`);+ await waitForProvider(page);+ const before = await awaitSourceQuiescence(page);+ expect(before).toContain('| Flounder | 4 |');+ expect(before).toContain('## Notes for Next Time');++ await expect(page.locator('text=PARSE ERROR')).toHaveCount(0);+ await page.screenshot({ path: 'test-results/prd-6914-open.png', fullPage: true });++ const after = await getSourceText(page);+ expect(after).toBe(before);+});++test('PRD-6914: clicking + escaping real fallback chrome does not mutate source bytes', async ({+ page,+ api,+}) => {+ const interactDoc = [+ '# Fishing Log',+ '',+ '| Species | Count |',+ '| --- | --- |',+ '| Flounder | 4 |',+ '| Lingcod | 0 |',+ '',+ '<Foo>text</Bar>',+ '',+ 'closing paragraph',+ '',+ ].join('\n');+ const docName = `prd-6914-interact-${Date.now()}`;+ await api.seedDocs([{ name: docName, markdown: interactDoc }]);++ await page.goto(`/#/${docName}`);+ await waitForProvider(page);+ const before = await awaitSourceQuiescence(page);+ expect(before).toContain('<Foo>text</Bar>');++ await expect(page.locator('text=PARSE ERROR').first()).toBeVisible({ timeout: 10_000 });+ const fallbackCm = page.locator('.raw-mdx-fallback-wrapper .cm-content').first();+ await expect(fallbackCm).toBeAttached({ timeout: 5_000 });++ await fallbackCm.click();+ await awaitSourceQuiescence(page);+ await page.keyboard.press('Escape');+ await page.locator('.ProseMirror').focus();+ const after = await awaitSourceQuiescence(page);++ expect(after).toBe(before);+ await expect(page.locator('.raw-mdx-fallback-wrapper')).toHaveCount(1);+});diff --git a/packages/core/src/markdown/index.ts b/packages/core/src/markdown/index.tsindex 3448ed4d3..248a9e766 100644--- a/packages/core/src/markdown/index.ts+++ b/packages/core/src/markdown/index.ts@@ -952,6 +952,7 @@ function buildMdastToPmHandlers(type: 'rawMdxFallbackMdast';originalType: string;value: string;+ unresolvedPosition?: boolean;position?: { start: { offset: number }; end: { offset: number } };}) => {if (!n.rawMdxFallback) return null;@@ -966,6 +967,7 @@ function buildMdastToPmHandlers(event: 'unknown-mdast-type',type: node.originalType,reason: `Unhandled mdast: ${node.originalType}`,+ unresolvedPosition: node.unresolvedPosition ?? false,}),);return n.rawMdxFallback.createAndFill(diff --git a/packages/core/src/markdown/unknown-mdast-guard.test.ts b/packages/core/src/markdown/unknown-mdast-guard.test.tsindex 7f8425f82..9f209a8cb 100644--- a/packages/core/src/markdown/unknown-mdast-guard.test.ts+++ b/packages/core/src/markdown/unknown-mdast-guard.test.ts@@ -70,7 +70,7 @@ describe('unknownMdastGuardPlugin (R8 wildcard)', () => {expect(para.children[2].type).toBe('text');});- test('handles unknown type with no position (defaults span to 0-0, value to type name)', () => {+ test('unknown type with no position degrades without fabricating type-name content', () => {const tree = {type: 'root',children: [{ type: 'typeWithoutPosition' }],@@ -79,7 +79,10 @@ describe('unknownMdastGuardPlugin (R8 wildcard)', () => {// biome-ignore lint/suspicious/noExplicitAny: test inspects mdast shapeconst child = tree.children[0] as any;expect(child.type).toBe('rawMdxFallbackMdast');- expect(child.value).toBe('typeWithoutPosition');+ expect(child.originalType).toBe('typeWithoutPosition');+ expect(child.value).not.toBe('typeWithoutPosition');+ expect(child.value).toBe('');+ expect(child.unresolvedPosition).toBe(true);});test('does not recurse into a node it just replaced', () => {@@ -133,6 +136,235 @@ describe('unknownMdastGuardPlugin (R8 wildcard)', () => {});});+describe('rawMdxFallbackMdast content preservation', () => {+ test('positioned node without offsets: fallback carries the source bytes, not the type name', () => {+ const tableBlock = '| Species | Count |\n| --- | --- |\n| Coho | 2 |';+ const src = `# Title\n\n${tableBlock}\n`;+ const tree = {+ type: 'root',+ children: [+ {+ type: 'futureTableVariant',+ position: {+ start: { line: 3, column: 1 },+ end: { line: 5, column: 13 },+ },+ },+ ],+ } as unknown as MdastRoot;+ unknownMdastGuardPlugin()(tree, new VFile(src));+ // biome-ignore lint/suspicious/noExplicitAny: test inspects mdast shape+ const child = tree.children[0] as any;+ expect(child.type).toBe('rawMdxFallbackMdast');+ expect(child.originalType).toBe('futureTableVariant');+ expect(child.value).not.toBe('futureTableVariant');+ expect(child.value).toBe(tableBlock);+ expect(child.unresolvedPosition).toBe(false);+ });++ test('zero-width span with offsets: fallback content is the (empty) slice, not the type name', () => {+ const src = 'hello world';+ const tree = {+ type: 'root',+ children: [+ {+ type: 'phantomMarker',+ position: {+ start: { line: 1, column: 6, offset: 5 },+ end: { line: 1, column: 6, offset: 5 },+ },+ },+ ],+ } as unknown as MdastRoot;+ unknownMdastGuardPlugin()(tree, new VFile(src));+ // biome-ignore lint/suspicious/noExplicitAny: test inspects mdast shape+ const child = tree.children[0] as any;+ expect(child.type).toBe('rawMdxFallbackMdast');+ expect(child.value).toBe('');+ expect(child.unresolvedPosition).toBe(false);+ });++ test('offsets beyond the source bounds: fallback must not fabricate type-name content', () => {+ const src = 'short doc\n';+ const tree = {+ type: 'root',+ children: [+ {+ type: 'staleSpanType',+ position: {+ start: { line: 99, column: 1, offset: 5000 },+ end: { line: 99, column: 20, offset: 5019 },+ },+ },+ ],+ } as unknown as MdastRoot;+ unknownMdastGuardPlugin()(tree, new VFile(src));+ // biome-ignore lint/suspicious/noExplicitAny: test inspects mdast shape+ const child = tree.children[0] as any;+ expect(child.type).toBe('rawMdxFallbackMdast');+ expect(child.value).not.toBe('staleSpanType');+ expect(child.value).toBe('');+ expect(child.unresolvedPosition).toBe(true);+ });++ test('line/column-only position with line beyond EOF: degrades to empty, not the type name', () => {+ const src = 'first line\nsecond line\n';+ const tree = {+ type: 'root',+ children: [+ {+ type: 'lineBeyondEofType',+ position: {+ start: { line: 7, column: 1 },+ end: { line: 7, column: 5 },+ },+ },+ ],+ } as unknown as MdastRoot;+ unknownMdastGuardPlugin()(tree, new VFile(src));+ // biome-ignore lint/suspicious/noExplicitAny: test inspects mdast shape+ const child = tree.children[0] as any;+ expect(child.type).toBe('rawMdxFallbackMdast');+ expect(child.originalType).toBe('lineBeyondEofType');+ expect(child.value).not.toBe('lineBeyondEofType');+ expect(child.value).toBe('');+ expect(child.unresolvedPosition).toBe(true);+ });++ test('line/column-only position with column past the line end: degrades to empty, not the type name', () => {+ const src = 'alpha\nbeta\n';+ const tree = {+ type: 'root',+ children: [+ {+ type: 'overlongColumnType',+ position: {+ start: { line: 1, column: 1 },+ end: { line: 1, column: 99 },+ },+ },+ ],+ } as unknown as MdastRoot;+ unknownMdastGuardPlugin()(tree, new VFile(src));+ // biome-ignore lint/suspicious/noExplicitAny: test inspects mdast shape+ const child = tree.children[0] as any;+ expect(child.type).toBe('rawMdxFallbackMdast');+ expect(child.originalType).toBe('overlongColumnType');+ expect(child.value).not.toBe('overlongColumnType');+ expect(child.value).toBe('');+ expect(child.unresolvedPosition).toBe(true);+ });++ test('inverted span (end before start) with in-bounds offsets: degrades to empty, not the type name', () => {+ const src = 'hello world';+ const tree = {+ type: 'root',+ children: [+ {+ type: 'invertedSpanType',+ position: {+ start: { line: 1, column: 9, offset: 8 },+ end: { line: 1, column: 4, offset: 3 },+ },+ },+ ],+ } as unknown as MdastRoot;+ unknownMdastGuardPlugin()(tree, new VFile(src));+ // biome-ignore lint/suspicious/noExplicitAny: test inspects mdast shape+ const child = tree.children[0] as any;+ expect(child.type).toBe('rawMdxFallbackMdast');+ expect(child.originalType).toBe('invertedSpanType');+ expect(child.value).not.toBe('invertedSpanType');+ expect(child.value).toBe('');+ expect(child.unresolvedPosition).toBe(true);+ });++ test('mixed points (offset-bearing start, line/column-only end): fallback slices the exact bytes', () => {+ const directive = '::directive::';+ const src = `intro\n${directive}\noutro\n`;+ const tree = {+ type: 'root',+ children: [+ {+ type: 'mixedPointDirective',+ position: {+ start: { offset: 6 },+ end: { line: 2, column: 14 },+ },+ },+ ],+ } as unknown as MdastRoot;+ unknownMdastGuardPlugin()(tree, new VFile(src));+ // biome-ignore lint/suspicious/noExplicitAny: test inspects mdast shape+ const child = tree.children[0] as any;+ expect(child.type).toBe('rawMdxFallbackMdast');+ expect(child.originalType).toBe('mixedPointDirective');+ expect(child.value).not.toBe('mixedPointDirective');+ expect(child.value).toBe(directive);+ expect(child.unresolvedPosition).toBe(false);+ });++ test('composed mixed-point failure (resolvable offset start, line beyond EOF end): degrades to empty', () => {+ const src = 'intro\nbody text\n';+ const tree = {+ type: 'root',+ children: [+ {+ type: 'partiallyResolvableType',+ position: {+ start: { offset: 6 },+ end: { line: 99, column: 1 },+ },+ },+ ],+ } as unknown as MdastRoot;+ unknownMdastGuardPlugin()(tree, new VFile(src));+ // biome-ignore lint/suspicious/noExplicitAny: test inspects mdast shape+ const child = tree.children[0] as any;+ expect(child.type).toBe('rawMdxFallbackMdast');+ expect(child.originalType).toBe('partiallyResolvableType');+ expect(child.value).not.toBe('partiallyResolvableType');+ expect(child.value).toBe('');+ expect(child.unresolvedPosition).toBe(true);+ });++ test('line or column below 1: degrades to empty, not the type name', () => {+ const src = 'content line\n';+ const tree = {+ type: 'root',+ children: [+ {+ type: 'zeroLineType',+ position: {+ start: { line: 0, column: 1 },+ end: { line: 1, column: 8 },+ },+ },+ {+ type: 'zeroColumnType',+ position: {+ start: { line: 1, column: 0 },+ end: { line: 1, column: 8 },+ },+ },+ ],+ } as unknown as MdastRoot;+ unknownMdastGuardPlugin()(tree, new VFile(src));+ // biome-ignore lint/suspicious/noExplicitAny: test inspects mdast shape+ const zeroLine = tree.children[0] as any;+ expect(zeroLine.type).toBe('rawMdxFallbackMdast');+ expect(zeroLine.value).not.toBe('zeroLineType');+ expect(zeroLine.value).toBe('');+ expect(zeroLine.unresolvedPosition).toBe(true);+ // biome-ignore lint/suspicious/noExplicitAny: test inspects mdast shape+ const zeroColumn = tree.children[1] as any;+ expect(zeroColumn.type).toBe('rawMdxFallbackMdast');+ expect(zeroColumn.value).not.toBe('zeroColumnType');+ expect(zeroColumn.value).toBe('');+ expect(zeroColumn.unresolvedPosition).toBe(true);+ });+});+function makePos(startOffset: number, endOffset: number) {return {start: { line: 1, column: startOffset + 1, offset: startOffset },diff --git a/packages/core/src/markdown/unknown-mdast-guard.ts b/packages/core/src/markdown/unknown-mdast-guard.tsindex 720e023b1..cd245c38c 100644--- a/packages/core/src/markdown/unknown-mdast-guard.ts+++ b/packages/core/src/markdown/unknown-mdast-guard.ts@@ -51,10 +51,16 @@ export function unknownMdastGuardPlugin() {};}+interface WalkablePoint {+ line?: number;+ column?: number;+ offset?: number;+}+interface WalkableNode {type?: string;children?: unknown[];- position?: { start?: { offset?: number }; end?: { offset?: number } };+ position?: { start?: WalkablePoint; end?: WalkablePoint };}function walk(node: WalkableNode | null | undefined, source: string): void {@@ -75,17 +81,46 @@ interface RawMdxFallbackMdast {type: 'rawMdxFallbackMdast';originalType: string;value: string;+ unresolvedPosition: boolean;position?: WalkableNode['position'];}+function resolvePointOffset(point: WalkablePoint | undefined, source: string): number | null {+ if (!point || typeof point !== 'object') return null;+ if (typeof point.offset === 'number') {+ return point.offset >= 0 && point.offset <= source.length ? point.offset : null;+ }+ const { line, column } = point;+ if (typeof line !== 'number' || typeof column !== 'number' || line < 1 || column < 1) {+ return null;+ }+ let lineStart = 0;+ for (let current = 1; current < line; current++) {+ const newline = source.indexOf('\n', lineStart);+ if (newline === -1) return null;+ lineStart = newline + 1;+ }+ const newline = source.indexOf('\n', lineStart);+ const lineEnd = newline === -1 ? source.length : newline;+ const offset = lineStart + column - 1;+ return offset <= lineEnd ? offset : null;+}++function resolveSourceSlice(position: WalkableNode['position'], source: string): string | null {+ if (!position) return null;+ const start = resolvePointOffset(position.start, source);+ const end = resolvePointOffset(position.end, source);+ if (start === null || end === null || end < start) return null;+ return source.slice(start, end);+}+export function toRawMdxFallbackMdast(node: WalkableNode, source: string): RawMdxFallbackMdast {- const start = node.position?.start?.offset ?? 0;- const end = node.position?.end?.offset ?? 0;- const sourceSlice = end > start ? source.slice(start, end) : '';+ const sourceSlice = resolveSourceSlice(node.position, source);return {type: 'rawMdxFallbackMdast',originalType: node.type ?? 'unknown',- value: sourceSlice || (node.type ?? 'unknown'),+ value: sourceSlice ?? '',+ unresolvedPosition: sourceSlice === null,position: node.position,};}