I want to add HTML entities like
or &
using a Dart class. I tried this :
my_element.nodes.add(new Text('&©'));
but as mentioned in Text class doc, markup is parsed into information, meaning everything is escaped, I guess. I read Node class doc looking for an Entity class; there is none, and I don't want to embed my entity in a tag:
my_element.nodes.add(new Element.html('<span>&©</span>'));
Which class should I use to add an HTML entity ?
DocumentFragment will do the job. This:
my_element.nodes.add(new DocumentFragment.html('&©'));
will output &©
in your HTML document.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With