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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user