diff --git a/changelog/src/main/org/apache/maven/changelog/ChangeLogEntry.java b/changelog/src/main/org/apache/maven/changelog/ChangeLogEntry.java index 653a44b3..1d7ab957 100644 --- a/changelog/src/main/org/apache/maven/changelog/ChangeLogEntry.java +++ b/changelog/src/main/org/apache/maven/changelog/ChangeLogEntry.java @@ -68,7 +68,7 @@ import java.util.Vector; * @task add time of change to the entry * @task investigate betwixt for toXML method * @author dIon Gillard - * @version $Id: ChangeLogEntry.java,v 1.2 2003/07/04 16:24:46 evenisse Exp $ + * @version $Id: ChangeLogEntry.java,v 1.3 2004/03/01 01:52:26 brett Exp $ */ public class ChangeLogEntry { @@ -209,7 +209,7 @@ public class ChangeLogEntry buffer.append("\t\t\n"); } buffer.append("\t\t\n"); buffer.append("\t\n"); @@ -304,6 +304,22 @@ public class ChangeLogEntry return TIME_FORMAT.format(getDate()); } + /** + * remove a ]]> from comments (replace it with ] ] >). + * @param message + * @return + */ + private String removeCDataEnd(String message) + { + // check for invalid sequence ]]> + int endCdata; + while (message != null && (endCdata = message.indexOf("]]>")) > -1) + { + message = message.substring(0, endCdata) + "] ] >" + message.substring(endCdata + 3, message.length()); + } + return message; + } + /** *

Escape the toString of the given object. * For use in an attribute value.

diff --git a/changelog/xdocs/changes.xml b/changelog/xdocs/changes.xml index 04d81bfc..f663fcc0 100644 --- a/changelog/xdocs/changes.xml +++ b/changelog/xdocs/changes.xml @@ -24,6 +24,9 @@ Add support for Perforce SCM and cleaned up some docs. + + Fix CDATA sections in comments. +