Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You're probably using <a href="http://api.dartlang.org/docs/releases/latest/dart_html/Element.html#innerHtml=" rel="nofollow">Element.innerHtml</a>. You should use <a href="http://api.dartlang.org/docs/releases/latest/dart_html/Element.html#setInnerHtml" rel="nofollow">Element.setInnerHtml</a> instead.</p> <p>As you can see with the parameters of this new method, the HTML code is now validated and filtered. To restore the old behavior, you must provide a validator or a tree sanitizer allowing all attributes.</p> <p>To explicitly allow "data" on anchors and buttons:</p> <pre class="lang-dart prettyprint-override"><code>// Call NodeValidatorBuilder.allowX() methods to customize the validator. final NodeValidatorBuilder _htmlValidator=new NodeValidatorBuilder.common() ..allowElement('a', attributes: ['data-target', 'data-toggle']) ..allowElement('button', attributes: ['data-target', 'data-toggle']); query('#anElement').setInnerHtml('a content', validator: _htmlValidator); </code></pre> <p><code>Element</code> and <code>CustomElement</code> classes use HTML sanitization in several places (<code>Element.html</code> factory, <code>innerHtml</code> property, <code>createFragment</code> method...).</p> <p>Even if you don't use these methods directly in your own code, they're called by the underlying Dart libraries (<code>CustomElement</code> class was created for <code>Polymer</code> library but is also used by latest releases of <code>Web UI</code> library).</p> <p>For the moment, there is NO way to globally disable or customize the default sanitization rules. So I guess you'll have to deal with <code>setInnerHtml</code> calls... or wait for another SDK release to fix the issue ("data-" attributes are valid HTML5 code, but the default sanitization filter doesn't allow them as well as inline styles: why these attributes are considered insecure?).</p> <p>Note: you should consider <a href="https://www.dartlang.org/polymer-dart/upgrading-to-polymer-from-web-ui.html" rel="nofollow">switching from Web UI to Polymer</a>, as <a href="https://www.dartlang.org/articles/web-ui/" rel="nofollow">Web UI is now deprecated</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload