wip: improve update-specs script

This commit is contained in:
2026-01-11 09:07:34 +00:00
parent 1eab53b7ba
commit 164729b57e
27 changed files with 998 additions and 857 deletions

View File

@@ -315,13 +315,9 @@ export async function parseSpecContent(
// Parse markdown to AST
const tree = unified().use(remarkParse).parse(markdown) as Root;
// Remove title (h1) and SVG image from the tree
// Remove title (h1) from the tree - it's displayed separately in the Hero
const nodes = tree.children.filter((node) => {
if (node.type === "heading" && (node as Heading).depth === 1) return false;
if (node.type === "paragraph") {
const text = extractText(node);
if (text.includes(".svg")) return false;
}
return true;
});