LeSuisse/vue-dompurify-html

V-dompurify - HTML automatically removes target=" blank"

95y opened this issue · 1 comments

95y commented

<a target="_blank">test</a> => <a>test</a>
I want to keep target=" blank"

Hello,

This is the expected behavior of DOMPurify, you can override it with a hook see cure53/DOMPurify#317 for more information.

You can setup DOMPurify hooks when adding vue-dompurify-html to your app;

app.use(VueDOMPurifyHTML, {
  hooks: {
    afterSanitizeAttributes: (currentNode) => {
      // Do something with the node
    }   
  }
});