Index: /Users/sean/Documents/workspace/customMagnolia/magnolia-taglib-cms/src/main/java/info/magnolia/cms/taglibs/Out.java =================================================================== --- /Users/sean/Documents/workspace/customMagnolia/magnolia-taglib-cms/src/main/java/info/magnolia/cms/taglibs/Out.java (revision 1866) +++ /Users/sean/Documents/workspace/customMagnolia/magnolia-taglib-cms/src/main/java/info/magnolia/cms/taglibs/Out.java (working copy) @@ -28,6 +28,7 @@ import javax.servlet.jsp.PageContext; import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.exception.NestableRuntimeException; import org.apache.commons.lang.time.DateFormatUtils; @@ -55,6 +56,12 @@ private String dateLanguage; private String lineBreak = DEFAULT_LINEBREAK; + + /** + * If set to true, output from this tag will be escaped using XML escaping rules. Defaults + * to false because existing code (especially FCKEditor paragraphs) rely on that behavior. + */ + private boolean escapeXml = false; /** * If set, the result of the evaluation will be set to a variable named from this attribute (and in the scope @@ -77,6 +84,14 @@ } /** + * Setter for escapeXml. + * @param var The var to set. + */ + public void setEscapeXml(boolean escapeXml) { + this.escapeXml = escapeXml; + } + + /** * Setter for scope. * @param scope The scope to set. */ @@ -231,6 +246,10 @@ .getActivePage((HttpServletRequest) pageContext.getRequest())); // static actpage break; } + + if ( escapeXml ) { + value = StringEscapeUtils.escapeXml( value ); + } if (var != null) { // set result as a variable Index: /Users/sean/Documents/workspace/customMagnolia/magnolia-taglib-cms/src/main/resources/META-INF/cms-taglib.tld =================================================================== --- /Users/sean/Documents/workspace/customMagnolia/magnolia-taglib-cms/src/main/resources/META-INF/cms-taglib.tld (revision 1866) +++ /Users/sean/Documents/workspace/customMagnolia/magnolia-taglib-cms/src/main/resources/META-INF/cms-taglib.tld (working copy) @@ -283,13 +283,20 @@ is not set. - - inherit - false - true - boolean - Inherit the value from parent pages, if not set in the current one. - + + inherit + false + true + boolean + Inherit the value from parent pages, if not set in the current one. + + + escapeXml + false + false + boolean + Determines whether output will be XML escaped. +