-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCDataNode.java
43 lines (36 loc) · 939 Bytes
/
CDataNode.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package org.jsoup.nodes;
import java.io.IOException;
/**
* A Character Data node, to support CDATA sections.
*/
public class CDataNode extends TextNode {
public CDataNode(String text) {
super(text);
}
@Override
public String nodeName() {
return "#cdata";
}
/**
* Get the unencoded, <b>non-normalized</b> text content of this CDataNode.
*
* @return unencoded, non-normalized text
*/
@Override
public String text() {
return getWholeText();
}
@Override
void outerHtmlHead(Appendable accum, int depth, Document.OutputSettings out) throws IOException {
accum
.append("<![CDATA[")
.append(getWholeText());
}
@Override
void outerHtmlTail(Appendable accum, int depth, Document.OutputSettings out) {
try {
accum.append("]]>");
} catch (IOException e) {
}
}
}