refactor: remove implicit content sniffing and table conversion

- Split loadCSV into parseCSVString (content) and loadCSVFromPath
  (path); drop isCSV/looksLikeCsv heuristics
- Delete coerceSparkTables and markedTable label-header magic;
  plain markdown tables now render as plain tables
- Add explicit markdown role=spark-table fence syntax that converts
  pipe tables to CSV at scan time, with dice-header validation
- Map ESM-only github-slugger and csv-parse browser build to CJS in
  jest config; add content-registry tests
This commit is contained in:
2026-09-08 21:33:12 +08:00
parent 5061c4d19d
commit 256c685f6c
13 changed files with 216 additions and 253 deletions
+2 -5
View File
@@ -12,11 +12,8 @@
// Mocks
// ---------------------------------------------------------------------------
jest.mock("csv-parse/browser/esm/sync", () => {
// Redirect browser-specific import to Node-compatible sync parser
const actual = jest.requireActual("csv-parse/sync");
return { parse: actual.parse };
});
// csv-parse/browser/esm/sync and github-slugger are mapped to CJS builds
// globally in jest.config.js moduleNameMapper.
jest.mock("github-slugger", () => {
// Simple slugger mock for testing