add option to disable auto-download of images for offline storage, #2859

This commit is contained in:
zadam
2022-05-21 14:00:53 +02:00
parent 2085dc5ed4
commit 819cf0907d
4 changed files with 32 additions and 8 deletions

View File

@@ -323,6 +323,10 @@ function replaceUrl(content, url, imageNote) {
}
function downloadImages(noteId, content) {
if (!optionService.getOptionBool("downloadImagesAutomatically")) {
return content;
}
const imageRe = /<img[^>]*?\ssrc=['"]([^'">]+)['"]/ig;
let imageMatch;