From b36ce9ed5b0bfe50b2dd42bc4e734bb0df7ba9ee Mon Sep 17 00:00:00 2001 From: Yuri Karamian Date: Sat, 6 Jun 2026 14:36:52 +0200 Subject: [PATCH] Fix code auto-linkify (#80) and currency text parsed as math (#81) --- src/lib/components/Editor.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/Editor.svelte b/src/lib/components/Editor.svelte index 046fcc7..3d84d00 100644 --- a/src/lib/components/Editor.svelte +++ b/src/lib/components/Editor.svelte @@ -2678,7 +2678,7 @@ const processed = line.replace(/`[^`]*`/g, m => '\x00'.repeat(m.length)); let result = line; let offset = 0; - for (const m of processed.matchAll(/(?`; result = result.slice(0, m.index! + offset) + html + result.slice(m.index! + m[0].length + offset); @@ -2834,7 +2834,7 @@ TableRow, CustomTableCell, CustomTableHeader, - Link.configure({ openOnClick: false, HTMLAttributes: { class: 'editor-link' }, isAllowedUri: (url, ctx) => ctx.defaultValidate(url) || !url.startsWith('javascript:') }), + Link.configure({ openOnClick: false, HTMLAttributes: { class: 'editor-link' }, isAllowedUri: (url, ctx) => ctx.defaultValidate(url) || !url.startsWith('javascript:'), shouldAutoLink: (url) => /^https?:\/\//.test(url) }), CustomImage.configure({ inline: true, HTMLAttributes: { class: 'editor-image' } }), Highlight.configure({ multicolor: true }), Typography,