1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-14 23:26:58 +02:00

Desktop: Resolves #3333: Improved escaping of Markdown titles in links

This commit is contained in:
Laurent Cozic
2020-06-07 12:55:40 +01:00
parent f36e0c2513
commit 40adbc5e9e
3 changed files with 4 additions and 9 deletions

View File

@@ -9,11 +9,6 @@ const listRegex = /^(\s*)([*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/;
const emptyListRegex = /^(\s*)([*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/;
const markdownUtils = {
// Not really escaping because that's not supported by marked.js
escapeLinkText(text) {
return text.replace(/(\[|\]|\(|\))/g, '_');
},
// Titles for markdown links only need escaping for [ and ]
escapeTitleText(text) {
return text.replace(/(\[|\])/g, '\\$1');