diff --git a/utils/markdown.js b/utils/markdown.js index a8ae8d4360286..8a69dd6689b85 100644 --- a/utils/markdown.js +++ b/utils/markdown.js @@ -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; } @@ -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;