Skip to content

fix: HTML vault extraction Editor preview (0.12.17) - #6

Merged
benjsmith merged 1 commit into
mainfrom
fix/vault-html-extraction-preview
Sep 13, 2026
Merged

benjsmith merged 1 commit into
mainfrom
fix/vault-html-extraction-preview

Conversation

@benjsmith

Copy link
Copy Markdown
Owner

Summary

  • Detect HTML-heavy vault extractions (*.html.extracted.md / *.htm.extracted.md, or body starting with <!DOCTYPE/<html/<head> / mostly-tagged HTML after frontmatter).
  • Render them in a sandboxed iframe (srcdoc) via DOMPurify whole-document sanitize (scripts/forms stripped; no allow-scripts / allow-same-origin).
  • Preview ↔ View source toggle keeps CodeMirror available for power users.
  • Inject controlled <base href> from frontmatter source_url when present so relative assets resolve.
  • Normal markdown .extracted.md sources stay on the existing code path.
  • Version bump to 0.12.17.

Test plan

  • Open …illustrated-transformer.html.extracted.md via a vault cite / Editor tab → rendered page, not raw tags
  • Toggle View source → CodeMirror HTML; toggle Preview back
  • Open a normal *.pdf.extracted.md / markdown extraction → unchanged CodeMirror / no HTML bar
  • Confirm scripts in extraction do not execute (sandbox + sanitize)
  • make refresh BUILD=1 on Mac Mini after merge

Detect *.html.extracted.md (and HTML-heavy bodies) and show a
sandboxed iframe preview instead of raw tags, with Preview ↔ View
source toggle. Scripts stripped via DOMPurify; optional source_url
base href. Normal markdown .extracted.md unchanged.

Signed-off-by: benjsmith <benjamincharlessmith@gmail.com>
@benjsmith
benjsmith merged commit f9c746e into main Sep 13, 2026
6 checks passed
@benjsmith
benjsmith deleted the fix/vault-html-extraction-preview branch September 13, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant