Skip to content

Commit d244ccd

Browse files
committed
Links fix
1 parent 061f660 commit d244ccd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

web/scripts/build.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,14 @@ async function buildVersionMenu(versions, currentVersion) {
9898
}
9999

100100
const marked = new Marked();
101+
const markedInline = new Marked();
101102
const customRenderer = {
102103
link({ href, text }) {
103-
if (/!\[.*\]\(.*\)/.test(text)) {
104-
text = marked.parseInline(text);
105-
}
104+
const htmlContent = markedInline.parseInline(text);
106105
const isExternal = /^https?:\/\//.test(href);
107106
let html = `<a href="${href}"`;
108107
if (isExternal) html += ' target="_blank"';
109-
html += `>${text}</a>`;
108+
html += `>${htmlContent}</a>`;
110109
return html;
111110
}
112111
};

0 commit comments

Comments
 (0)