Skip to content

Commit

Permalink
docs(markdown): parse :::note's text as MD elements
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Sep 9, 2024
1 parent 718bd9b commit 239c800
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions utils/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function buildTree(lines) {
tokens.push(line.substring(indent.length));
line = lines[++i];
}
node.text = tokens.join('↵');
node.children = buildTree(tokens);
appendNode(indent, node);
continue;
}
Expand Down Expand Up @@ -341,7 +341,8 @@ function innerRenderMdNode(indent, node, lastNode, result, options) {
if (node.type === 'note') {
newLine();
result.push(`${indent}:::${node.noteType}`);
result.push(wrapText(node.text, options, indent));
for (const child of node.children || [])
innerRenderMdNode(indent, child, lastNode, result, options);
result.push(`${indent}:::`);
newLine();
return;
Expand Down

0 comments on commit 239c800

Please sign in to comment.