Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: only rewrite html if images are found

Abdullah Atta8c58c512edac
diff --git a/packages/core/content-types/tiptap.js b/packages/core/content-types/tiptap.js
index 6a31c61b4..55a872e9b 100644
--- a/packages/core/content-types/tiptap.js
+++ b/packages/core/content-types/tiptap.js
@@ -110,6 +110,7 @@ export class Tiptap {
}).parse(this.data);
const images = {};
+ let hasImages = false;
for (let i = 0; i < hashes.length; ++i) {
const hash = hashes[i];
const src = await getData(hash, {
@@ -118,8 +119,10 @@ export class Tiptap {
});
if (!src) continue;
images[hash] = src;
+ hasImages = true;
}
+ if (!hasImages) return this.data;
return new HTMLRewriter({
ontag: (name, attr) => {
const hash = attr[ATTRIBUTES.hash];