提交 4c02cf69 编写于 作者: D DCloud_LXH

chore: createSidebar

上级 351872d1
......@@ -22,12 +22,17 @@ function parseBar(file, options) {
token.children.forEach(child => {
switch (child.type) {
case 'text':
text = child.content
text = text || child.content
break;
case 'link_open':
child.attrs.forEach(attr => {
if (attr[0] === 'href') link = attr[1]
})
const len = child.attrs.length
for (let index = 0; index < len; index++) {
const attr = child.attrs[index];
if (attr[0] === 'href') {
link = link || attr[1]
break;
}
}
break;
case 'code_inline':
try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册