/** * Get the unencoded, <b>non-normalized</b> text content of this CDataNode. * @return unencoded, non-normalized text */ @Override public String text() { return getWholeText(); }
void insert(Token.Character token) { final String data = token.getData(); insertNode(token.isCData() ? new CDataNode(data) : new TextNode(data)); }
void insert(Token.Character characterToken) { Node node; // characters in script and style go in as datanodes, not text nodes final String tagName = currentElement().tagName(); final String data = characterToken.getData(); if (characterToken.isCData()) node = new CDataNode(data); else if (tagName.equals("script") || tagName.equals("style")) node = new DataNode(data); else node = new TextNode(data); currentElement().appendChild(node); // doesn't use insertNode, because we don't foster these; and will always have a stack. }
@Override void outerHtmlHead(Appendable accum, int depth, Document.OutputSettings out) throws IOException { accum .append("<![CDATA[") .append(getWholeText()); }
sb.append(cDataNode.getWholeText());