chore(frontend): commit remaining workspace updates
This commit is contained in:
14
tests/markdown-headings.test.mjs
Normal file
14
tests/markdown-headings.test.mjs
Normal file
@@ -0,0 +1,14 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import { extractMarkdownHeadings } from "../src/lib/markdown-headings.ts";
|
||||
|
||||
test("keeps markdown heading IDs tied to their source lines", () => {
|
||||
assert.deepEqual(
|
||||
extractMarkdownHeadings("# مقدمه\n\n## موضوع\n## موضوع"),
|
||||
[
|
||||
{ id: "مقدمه", level: 1, text: "مقدمه", line: 1 },
|
||||
{ id: "موضوع", level: 2, text: "موضوع", line: 3 },
|
||||
{ id: "موضوع-2", level: 2, text: "موضوع", line: 4 },
|
||||
],
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user