Skip to content

Commit f52a682

Browse files
fommilashawley
authored andcommitted
Split CDATA containing closing triad ]]>
1 parent 06a7758 commit f52a682

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared/src/main/scala/scala/xml/PCData.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class PCData(data: String) extends Atom[String](data) {
2727
* @return the input string buffer with the formatted CDATA section
2828
*/
2929
override def buildString(sb: StringBuilder): StringBuilder =
30-
sb append "<![CDATA[%s]]>".format(data)
30+
sb append "<![CDATA[%s]]>".format(data.replaceAll("]]>", "]]]]><![CDATA[>"))
3131
}
3232

3333
/**

0 commit comments

Comments
 (0)