fix: Document importer only replaces first base64 encoded image when there are multiple identical images in a document
closes #5653
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
import emojiRegex from "emoji-regex";
|
import emojiRegex from "emoji-regex";
|
||||||
|
import escapeRegExp from "lodash/escapeRegExp";
|
||||||
import truncate from "lodash/truncate";
|
import truncate from "lodash/truncate";
|
||||||
import mammoth from "mammoth";
|
import mammoth from "mammoth";
|
||||||
import quotedPrintable from "quoted-printable";
|
import quotedPrintable from "quoted-printable";
|
||||||
@@ -221,7 +222,10 @@ async function documentImporter({
|
|||||||
ip,
|
ip,
|
||||||
transaction,
|
transaction,
|
||||||
});
|
});
|
||||||
text = text.replace(uri, attachment.redirectUrl);
|
text = text.replace(
|
||||||
|
new RegExp(escapeRegExp(uri), "g"),
|
||||||
|
attachment.redirectUrl
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// It's better to truncate particularly long titles than fail the import
|
// It's better to truncate particularly long titles than fail the import
|
||||||
|
|||||||
Reference in New Issue
Block a user