Merge branch 'release/v1.21.4'

This commit is contained in:
Ralph Slooten
2024-11-17 17:56:26 +13:00
2 changed files with 9 additions and 2 deletions

View File

@@ -2,6 +2,12 @@
Notable changes to Mailpit will be documented in this file.
## [v1.21.4]
### Bugfix
- Fix external CSS stylesheet loading in HTML preview ([#388](https://github.com/axllent/mailpit/issues/388))
## [v1.21.3]
### Chore

View File

@@ -78,8 +78,9 @@ export default {
// remove bad HTML, JavaScript, iframes etc
sanitizedHTML() {
// set target & rel on all links
DOMPurify.addHook('afterSanitizeAttributes', (node) => {
if (node.hasAttribute('href') && node.getAttribute('href').substring(0, 1) == '#') {
if (node.tagName != 'A' || (node.hasAttribute('href') && node.getAttribute('href').substring(0, 1) == '#')) {
return
}
if ('target' in node) {
@@ -115,7 +116,7 @@ export default {
'vertical-align',
'vlink',
'vspace',
'xml:lang'
'xml:lang',
],
FORBID_ATTR: ['script'],
}