Escaping markdown characters just to be safe

This commit is contained in:
Melanie Kat 2025-12-21 17:52:53 -08:00
parent 08c149e478
commit 03ca72d917

View file

@ -10,7 +10,21 @@ export function markdownLinkRegex(url) {
} }
export function markdownCharEscape(text) { 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) { export async function getRSSItemTitle(feedUrl) {