feat: Unify spark table detection and content resolution

Export isSparkTableHeader from content-registry and use it in both CLI
and frontend table parsing. Add resolveContentRef to resolve content
references consistently. Write processed registry content back to the
file index so browser mode renders identically to CLI mode.
This commit is contained in:
hyper
2026-08-07 13:15:51 +08:00
parent 0a68122efd
commit c03528a293
7 changed files with 114 additions and 18 deletions
+9
View File
@@ -13,6 +13,7 @@ import { createSignal } from "solid-js";
import {
getPathsByExtension,
getIndexedData,
setIndexedData,
setInlineResolver,
} from "../../data-loader/file-index";
import {
@@ -119,6 +120,14 @@ async function scanClientSide(): Promise<JournalCompletions> {
const registry = buildRegistryFromIndex(index);
activeRegistry = registry;
// Write the processed (stripped) content back into the file index so
// Article/md-embed render the same content as CLI mode (spark tables
// coerced, attributed blocks processed, data-spark injected).
for (const [path, content] of Object.entries(registry.pathIndex)) {
setIndexedData(path, content);
}
return deriveCompletions(registry);
}