diff --git a/src/components/input/editor.vue b/src/components/input/editor.vue index bdbeffc8..546deba6 100644 --- a/src/components/input/editor.vue +++ b/src/components/input/editor.vue @@ -317,6 +317,9 @@ export default { return checkboxes[n] }, renderPreview() { + const renderer = new marked.Renderer() + const linkRenderer = renderer.link + let checkboxNum = -1 marked.use({ renderer: { @@ -340,6 +343,11 @@ export default { checkboxNum++ return `` }, + link: (href, title, text) => { + const isLocal = href.startsWith(`${location.protocol}//${location.hostname}`) + const html = linkRenderer.call(renderer, href, title, text) + return isLocal ? html : html.replace(/^