1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Chore: Fix build (#13050)

This commit is contained in:
Henry Heino
2025-08-26 08:40:26 -07:00
committed by GitHub
parent c530b07f45
commit 4185afebdb
2 changed files with 11 additions and 18 deletions

View File

@@ -10,24 +10,6 @@ import convertHtmlToMarkdown from './convertHtmlToMarkdown';
import { ExportedWebViewGlobals as MarkdownEditorWebViewGlobals } from '../../markdownEditorBundle/types';
import { EditorEventType } from '@joplin/editor/events';
const postprocessHtml = (html: HTMLElement) => {
// Fix resource URLs
const resources = html.querySelectorAll<HTMLImageElement>('img[data-resource-id]');
for (const resource of resources) {
const resourceId = resource.getAttribute('data-resource-id');
resource.src = `:/${resourceId}`;
}
// Restore HREFs
const links = html.querySelectorAll<HTMLAnchorElement>('a[href="#"][data-original-href]');
for (const link of links) {
link.href = link.getAttribute('data-original-href');
link.removeAttribute('data-original-href');
}
return html;
};
const wrapHtmlForMarkdownConversion = (html: HTMLElement) => {
// Add a container element -- when converting to HTML, Turndown
// sometimes doesn't process the toplevel element in the same way