From 03ca72d917e67fc3d4c2975fa688a633db8a9588 Mon Sep 17 00:00:00 2001 From: Melanie Kat <318003+ZicklePop@users.noreply.github.com> Date: Sun, 21 Dec 2025 17:52:53 -0800 Subject: [PATCH] Escaping markdown characters just to be safe --- utils.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/utils.js b/utils.js index 61ffcac..b016db0 100644 --- a/utils.js +++ b/utils.js @@ -10,7 +10,21 @@ export function markdownLinkRegex(url) { } export function markdownCharEscape(text) { - return text.replaceAll('-', '\\-') + return text + .replaceAll('`', '\\`') + .replaceAll('*', '\\*') + .replaceAll('_', '\\_') + .replaceAll('{', '\\{') + .replaceAll('}', '\\}') + .replaceAll('[', '\\[') + .replaceAll(']', '\\]') + .replaceAll('(', '\\(') + .replaceAll(')', '\\)') + .replaceAll('#', '\\#') + .replaceAll('+', '\\+') + .replaceAll('-', '\\-') + .replaceAll('.', '\\.') + .replaceAll('!', '\\!') } export async function getRSSItemTitle(feedUrl) {