Class CWMcleaner

  • All Implemented Interfaces:
    TextSubstitutions

    public class CWMcleaner
    extends java.lang.Object
    implements TextSubstitutions
    The pegDown processor gets confused by passthrough HTML display elements (though inline elements are OK)., often adding bogus <p> elements around the opening and/or closing tag, resulting in bad XML. As a workaround, the macro processor can be used to insert <cwm tag='tagname' ... /> empty elements. Here we change these to <tagname ... >, after stripping away any immediately adjacent <p> and </p> tags.
    • Constructor Summary

      Constructors 
      Constructor Description
      CWMcleaner()
      Create a cleaner.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String apply​(java.lang.String target)
      Apply substitutions.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CWMcleaner

        public CWMcleaner()
        Create a cleaner.
    • Method Detail

      • apply

        public final java.lang.String apply​(java.lang.String target)
        Apply substitutions.
        Specified by:
        apply in interface TextSubstitutions
        Parameters:
        target - original string
        Returns:
        original after applying substitutions.