Skip to content

Commit

Permalink
Update Html.js to remove x-html tags before rendering
Browse files Browse the repository at this point in the history
Fix for #1860 to remove <x-html></x-html> tags that might be emitted by certain email clients.

Tested by modifying locally using JS debugger and Snappymail JS debug mode.
  • Loading branch information
hungyao authored Dec 7, 2024
1 parent 7eaa065 commit e16d0b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev/Common/Html.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ export const
// Not supported by <template> element
// .replace(/<!doctype[^>]*>/gi, '')
// .replace(/<\?xml[^>]*\?>/gi, '')
// https://github.com/the-djmaze/snappymail/issues/1860
.replace(/<(\/?)x-html(\s[^>]*)?>/gi, '')
.replace(/<(\/?)head(\s[^>]*)?>/gi, '')
.replace(/<(\/?)body(\s[^>]*)?>/gi, '<$1div class="mail-body"$2>')
// .replace(/<\/?(html|head)[^>]*>/gi, '')
Expand Down

0 comments on commit e16d0b5

Please sign in to comment.