Skip to content

Build your personal knowledge base with Trilium Notes

Merge remote-tracking branch 'origin/stable'

zadamc92526372cd3
diff --cc src/services/notes.js
index d6eafe88e7,646d6bc5f8..b33d11cbe2
--- a/src/services/notes.js
+++ b/src/services/notes.js
@@@ -277,18 -277,12 +277,12 @@@ async function downloadImage(noteId, im
const downloadImagePromises = {};
function replaceUrl(content, url, imageNote) {
- if (url.length > 2000) {
- // for very large inline base64 images which fail on regex max size
- return content.replace(url, `api/images/${imageNote.noteId}/${imageNote.title}`);
- }
- else {
- const quotedUrl = utils.quoteRegex(url);
+ const quotedUrl = utils.quoteRegex(url);
- return content.replace(new RegExp(`\\s+src=[\"']${quotedUrl}[\"']`, "g"), ` src="api/images/${imageNote.noteId}/${imageNote.title}"`);
- }
+ return content.replace(new RegExp(`\\s+src=[\"']${quotedUrl}[\"']`, "g"), ` src="api/images/${imageNote.noteId}/${imageNote.title}"`);
}
-async function downloadImages(noteId, content) {
+function downloadImages(noteId, content) {
const re = /<img[^>]*?\ssrc=['"]([^'">]+)['"]/ig;
let match;