Work on inline attributes

This commit is contained in:
Zef Hemel
2023-07-24 19:54:31 +02:00
parent a1c623b1f5
commit 2b494f263e
12 changed files with 211 additions and 16 deletions
+13
View File
@@ -89,3 +89,16 @@ Deno.test("Test directive parser", () => {
tree = parse(lang, orderByExample);
console.log("Tree", JSON.stringify(tree, null, 2));
});
const inlineAttributeSample = `
Hello there [a link](http://zef.plus) and [age:: 100]
`;
Deno.test("Test inline attribute syntax", () => {
const lang = buildMarkdown([]);
const tree = parse(lang, inlineAttributeSample);
const nameNode = findNodeOfType(tree, "AttributeName");
assertEquals(nameNode?.children![0].text, "age");
const valueNode = findNodeOfType(tree, "AttributeValue");
assertEquals(valueNode?.children![0].text, "100");
});