DocumentFragment will do the job. This:
my_element.nodes.add(new DocumentFragment.html('&©'));
will output &©
in your HTML document.
Pregunta
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 ?
Solución
DocumentFragment will do the job. This:
my_element.nodes.add(new DocumentFragment.html('&©'));
will output &©
in your HTML document.