优化bug
This commit is contained in:
parent
63d8ef5897
commit
c3456dea16
@ -334,9 +334,7 @@ export function convertToWechat(markdown: string, options: RendererOptions = def
|
|||||||
...linkStyle
|
...linkStyle
|
||||||
}
|
}
|
||||||
const styleStr = cssPropertiesToString(style)
|
const styleStr = cssPropertiesToString(style)
|
||||||
const tokens = marked.Lexer.lexInline(text)
|
return `<a href="${href}"${title ? ` title="${title}"` : ''}${styleStr ? ` style="${styleStr}"` : ''}>${text}</a>`
|
||||||
const content = marked.Parser.parseInline(tokens, { renderer })
|
|
||||||
return `<a href="${href}"${title ? ` title="${title}"` : ''}${styleStr ? ` style="${styleStr}"` : ''}>${content}</a>`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重写 image 方法
|
// 重写 image 方法
|
||||||
@ -409,8 +407,6 @@ export function convertToWechat(markdown: string, options: RendererOptions = def
|
|||||||
return `<li${styleStr ? ` style="${styleStr}"` : ''}>${content}</li>`
|
return `<li${styleStr ? ` style="${styleStr}"` : ''}>${content}</li>`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 添加删除线支持
|
// 添加删除线支持
|
||||||
renderer.del = function({ text }: Tokens.Del) {
|
renderer.del = function({ text }: Tokens.Del) {
|
||||||
const delStyle = (mergedOptions.inline?.del || {}) as StyleOptions
|
const delStyle = (mergedOptions.inline?.del || {}) as StyleOptions
|
||||||
|
Loading…
Reference in New Issue
Block a user