1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Desktop: Various improvements to Markdown import and export (#5290)

In preparation for #5224
This commit is contained in:
Caleb John
2021-08-22 16:35:45 -07:00
committed by GitHub
parent e3bd24f819
commit 4ba417a2f4
33 changed files with 419 additions and 127 deletions

View File

@@ -100,6 +100,12 @@ const markdownUtils = {
return output;
},
replaceResourceUrl(md: string, urlToReplace: string, id: string) {
const linkRegex = `(?<=\\]\\()\\<?${urlToReplace}\\>?(?=.*\\))`;
const reg = new RegExp(linkRegex, 'g');
return md.replace(reg, `:/${id}`);
},
extractImageUrls(md: string) {
return markdownUtils.extractFileUrls(md,true);
},