package com.celements.rendering;

import org.xwiki.component.annotation.Component;

@Component
public class XHTMLtoHTML5cleanup implements IXHTMLtoHTML5cleanup {

  @Deprecated
  public String cleanAll(String xhtml) {
    String html5 = removeSelfclosingTags(xhtml);
    return html5;
  }
  
  /*
   * Slef closing tags are allowed as syntactic sugar (hence not required)
   */
  public String removeSelfclosingTags(String xhtml) {
    if(xhtml != null) {
      return xhtml.replaceAll("<((\".*?\"|'.*?'|[^>\"]*)*)/>", "<$1>");
    }
    return null;
  }
}
@@ -81,18 +81,150 @@
 t;%0A%0A
-@Component
+/**%0A * @author Edoardo Beutler%0A * @deprecated Slef closing tags are allowed as syntactic sugar (hence not required)%0A */%0A@Component%0A@Deprecated
 %0Apub

mark XHTMLtoHTML5cleanup class as deprecated