From 8af6f359e28289167357a98a7cf10ff40b30b936 Mon Sep 17 00:00:00 2001 From: Chaitanya Date: Thu, 27 Jun 2024 16:38:55 +0530 Subject: [PATCH] fix: Escape underscores in links (#4797) --- src/components/BaseMarkdown.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/BaseMarkdown.vue b/src/components/BaseMarkdown.vue index 87a1c33b9b31..333415d9a8f6 100644 --- a/src/components/BaseMarkdown.vue +++ b/src/components/BaseMarkdown.vue @@ -29,6 +29,8 @@ const markdown = computed(() => { } body = body.replace(/!\[.*?\]\((ipfs:\/\/[a-zA-Z0-9]+?)\)/g, replaceIpfsUrl); + // if body contains a link that contain `_` , replace it with `\_` to escape it + body = body.replace(/(http.*?)(?=_)/g, '$1\\'); return remarkable.render(body); });