Bootjack popover body links are sanitized by Dart

122 Views Asked by At

I have this html button:

<button data-toggle="popover" data-placement="bottom" title="" data-content="Dart. <a href='https://www.dartlang.org/'>Link</a>" data-original-title="Popover">Dart</button>

And from Dart wire the button as popover element:

$('[data-toggle]').forEach((Element elem) {  
  new Popover(elem, html:true);
});

I'm not using Popover.wire(elem); because I need to add the html attribute and adding the attribute via setInnerHtml does not activate the html attribute.

The issue is that whenever I click on the button, Dart remove the href attribute from my anchor element. I need to know how resolve this issue. Thank you.

1

There are 1 best solutions below

0
On BEST ANSWER

I found that Bootjack uses innerHtml to set the value for the content of popovers. I changed tooltip.dart to set the content value using setInnerHtml with a NodeValidatorBuilder. This stopped Dart from sanitizing the href attribute inside popovers. I requested a pull to update Bootjack repo with these changes.