Skip to content

v1.0.16

Choose a tag to compare

@bwat47 bwat47 released this 19 Sep 15:13
· 504 commits to main since this release

Improved fallback logic that was implemented in previous release so that we only fall back to plain text if DOM sanitization itself fails (previously it would have failed if any of the "pre" steps failed before DOMpurify)

  • Best case: Full DOM processing with all enhancements
  • Good case: DOMPurify + partial enhancements (some post-processing failed)
  • Acceptable case: DOMPurify-only on raw HTML (DOM processing failed)
  • Safe case: Plain text (DOMPurify completely failed)

  • DOM parsing failures → Try sanitizing raw HTML
  • DOMPurify failures → Plain text
  • Post-processing failures → Use already-sanitized HTML

  • Early DOM parsing failure (no rawBody) → Still attempts sanitization
  • Late processing failure → Can use cached sanitizedHtml OR attempt fresh sanitization
  • Complete DOMPurify failure → Always has plain text as final fallback