diff --git a/src/renderer/services/export.ts b/src/renderer/services/export.ts index 7324898d..1c76b9cd 100644 --- a/src/renderer/services/export.ts +++ b/src/renderer/services/export.ts @@ -297,7 +297,14 @@ export async function convertCurrentDocument (opts: ConvertOpts): Promise // export html directly if (opts.fromType === 'html' && opts.toType === 'html') { - const html = await wrapExportProcess('html', () => getContentHtml(opts.fromHtmlOptions)) + const html = await wrapExportProcess('html', () => getContentHtml({ + ...opts.fromHtmlOptions, + nodeProcessor: node => { + if (node.tagName === 'IFRAME' && !/https?:\/\//.test(node.getAttribute('src') || '')) { + node.outerHTML = 'This iframe is not supported in export.' + } + } + })) return new Blob([ buildHtml(fileName, html, opts.fromHtmlOptions || { includeStyle: false, includeToc: [] }) ], { type: 'text/html' }) @@ -317,6 +324,11 @@ export async function convertCurrentDocument (opts: ConvertOpts): Promise if (node.classList.contains('katex-html')) { node.remove() } + + // remove unsupported iframe + if (node.tagName === 'IFRAME' && !/https?:\/\//.test(node.getAttribute('src') || '')) { + node.outerHTML = 'This iframe is not supported in export.' + } } }))