Skip to content

Commit 3618969

Browse files
fommilashawley
authored andcommitted
Split CDATA containing closing triad ]]>
1 parent 6749c5c commit 3618969

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: shared/src/main/scala/scala/xml/PCData.scala

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

3232
/**

0 commit comments

Comments
 (0)