From 97a04ea9e3af175ed6bbef8026d2e9ed09fd51da Mon Sep 17 00:00:00 2001 From: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com> Date: Thu, 11 Jan 2024 13:22:52 -0800 Subject: [PATCH] Chore: Merge release-2.13 into dev (#9698) Co-authored-by: Laurent Cozic --- packages/renderer/HtmlToHtml.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/renderer/HtmlToHtml.ts b/packages/renderer/HtmlToHtml.ts index c424736a0..552d12a4c 100644 --- a/packages/renderer/HtmlToHtml.ts +++ b/packages/renderer/HtmlToHtml.ts @@ -42,6 +42,11 @@ interface RenderOptions { itemIdToUrl?: ItemIdToUrlHandler; allowedFilePrefixes?: string[]; whiteBackgroundNoteRendering?: boolean; + + // For compatibility with MdToHtml options: + plugins?: { + link_open?: { linkRenderingType?: number }; + }; } // https://github.com/es-shims/String.prototype.trimStart/blob/main/implementation.js @@ -107,7 +112,7 @@ export default class HtmlToHtml { ...options, }; - const cacheKey = md5(escape(markup)); + const cacheKey = md5(escape(JSON.stringify({ markup, options }))); let html = this.cache_.value(cacheKey); if (!html) { @@ -142,6 +147,7 @@ export default class HtmlToHtml { ResourceModel: this.ResourceModel_, postMessageSyntax: options.postMessageSyntax, enableLongPress: options.enableLongPress, + ...options.plugins?.link_open, }); if (!r.html) return null;