mirror of
https://github.com/jimeh/commonflow.org.git
synced 2026-02-19 05:46:40 +00:00
wip: improve update-specs script
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user