Albêr Albêr - 3 months ago 16
Dart Question

Specific attributes are being excluded from darts Element.setInnerHtml()

I've encountered the following problem:

I've encountered the following problem:

Before mods may click 'duplicate', it isn't. I've searched the problem, found 'solutions', applied 'solutions' and they didn't work. So the question could be 'Why is my 'solution' not working?' or the question could be 'What is the actual solution?'

The responsible code for this is

querySelector("#element").setInnerHtml(some_element.outerHtml, treeSanitizer: NodeTreeSanitizer.trusted);


What am I doing wrong?

Answer

I found out to apply the sanitizer to the Element.

Element element = new Element.html('<a data-tag="value">thing</a>'), treeSanitizer: NodeTreeSanitizer.trusted)

Comments