feat(editor): Implement HTML sanitization for Notification and Message components (#4081)
* feat(editor): Implement HTML sanitization when using `dangerouslyUseHTMLString` option of Notification and Message components * 🐛 Implement mechanism to allow for A href actions from locale strings * 🐛 Prevent link action default * ♻️ Use `xss` library instead of `sanitize-html` to handle sanitization * 🔥 Remove `onLinkClick` functionality of `$showMessage`
This commit is contained in:
@@ -7,6 +7,7 @@ import mixins from 'vue-typed-mixins';
|
||||
|
||||
import { showMessage } from './mixins/showMessage';
|
||||
import { ElMessageComponent } from 'element-ui/types/message';
|
||||
import { sanitizeHtml } from '@/utils';
|
||||
|
||||
export default mixins(
|
||||
showMessage,
|
||||
@@ -28,7 +29,7 @@ export default mixins(
|
||||
},
|
||||
mounted() {
|
||||
this.alert = this.$showAlert({
|
||||
message: this.message,
|
||||
message: sanitizeHtml(this.message),
|
||||
type: 'warning',
|
||||
duration: 0,
|
||||
showClose: true,
|
||||
|
||||
Reference in New Issue
Block a user