use of org.jsoup.nodes.CDataNode in project jsoup by jhy.
the class HtmlTreeBuilder method insert.
void insert(Token.Character characterToken) {
final Node node;
// will be doc if no current element; allows for whitespace to be inserted into the doc root object (not on the stack)
Element el = currentElement();
final String tagName = el.normalName();
final String data = characterToken.getData();
if (characterToken.isCData())
node = new CDataNode(data);
else if (isContentForTagData(tagName))
node = new DataNode(data);
else
node = new TextNode(data);
// doesn't use insertNode, because we don't foster these; and will always have a stack.
el.appendChild(node);
}