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:
@@ -1,4 +1,5 @@
|
||||
import type { MarkedExtension, Tokens } from "marked";
|
||||
import { isSparkTableHeader } from "../cli/content-registry";
|
||||
|
||||
/**
|
||||
* 将表格数据转换为 CSV 格式字符串
|
||||
@@ -35,7 +36,7 @@ export default function markedTable(): MarkedExtension {
|
||||
let remix = "";
|
||||
|
||||
const labelIndex = header.findIndex((cell) => {
|
||||
if (cell.text === "md-roll-label" || cell.text.match(/(\d+)?d\d+/)) {
|
||||
if (cell.text === "md-roll-label" || isSparkTableHeader(cell.text)) {
|
||||
roll = " roll=true";
|
||||
return true;
|
||||
} else if (cell.text === "md-remix-label") {
|
||||
|
||||
Reference in New Issue
Block a user