diff --git a/docs/.vuepress/markdown/createSidebar.js b/docs/.vuepress/markdown/createSidebar.js index 30629a94d328894490ce65991cd755227e5bdae9..b1b36ea1753b19f662067fa9ceea3a150856c32a 100644 --- a/docs/.vuepress/markdown/createSidebar.js +++ b/docs/.vuepress/markdown/createSidebar.js @@ -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 {