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

Desktop: Fixes #9304: Fix HTML resource links lost when editing notes in the rich text editor (#9435)

This commit is contained in:
Henry Heino
2023-12-06 11:17:16 -08:00
committed by GitHub
parent c0c32a7ac1
commit 92a0964a8d
14 changed files with 125 additions and 17 deletions

View File

@@ -38,6 +38,7 @@ interface RenderOptions {
postMessageSyntax: string;
enableLongPress: boolean;
itemIdToUrl?: ItemIdToUrlHandler;
allowedFilePrefixes?: string[];
}
// https://github.com/es-shims/String.prototype.trimStart/blob/main/implementation.js
@@ -99,7 +100,9 @@ export default class HtmlToHtml {
let html = this.cache_.value(cacheKey);
if (!html) {
html = htmlUtils.sanitizeHtml(markup);
html = htmlUtils.sanitizeHtml(markup, {
allowedFilePrefixes: options.allowedFilePrefixes,
});
html = htmlUtils.processImageTags(html, (data: any) => {
if (!data.src) return null;