Escaping markdown characters just to be safe
This commit is contained in:
parent
08c149e478
commit
03ca72d917
1 changed files with 15 additions and 1 deletions
16
utils.js
16
utils.js
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue