mirror of
https://github.com/doocs/md.git
synced 2025-02-12 01:30:08 +08:00
fix: maximum call stack size exceeded in parse link
This commit is contained in:
parent
8927c0a4c7
commit
617ad219c4
@ -212,9 +212,8 @@ export function initRenderer(opts: IOpts) {
|
|||||||
return `<figure ${figureStyles}><img ${imgStyles} src="${href}" title="${title}" alt="${text}"/>${subText}</figure>`
|
return `<figure ${figureStyles}><img ${imgStyles} src="${href}" title="${title}" alt="${text}"/>${subText}</figure>`
|
||||||
},
|
},
|
||||||
|
|
||||||
link({ href, title, text }: Tokens.Link): string {
|
link({ href, title, text, tokens }: Tokens.Link): string {
|
||||||
const parsedText = marked.parseInline(text) as string
|
const parsedText = this.parser.parseInline(tokens)
|
||||||
|
|
||||||
if (href.startsWith(`https://mp.weixin.qq.com`)) {
|
if (href.startsWith(`https://mp.weixin.qq.com`)) {
|
||||||
return `<a href="${href}" title="${title || text}" ${styles(`wx_link`)}>${parsedText}</a>`
|
return `<a href="${href}" title="${title || text}" ${styles(`wx_link`)}>${parsedText}</a>`
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user