Unverified Commit d1881899 authored by Thomas Mortagne's avatar Thomas Mortagne Committed by GitHub
Browse files

Merge pull request #187 from oanalavinia/html_types

parents c4bd8dde dc870a70
......@@ -25,7 +25,9 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.collections4.SetUtils;
import org.apache.commons.lang3.builder.CompareToBuilder;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
......@@ -123,6 +125,14 @@ public class SyntaxType implements Comparable<SyntaxType>
*/
public static final SyntaxType HTML = register("html", "HTML");
/**
* Syntaxes that are from the HTML family.
*
* @since 13.9RC1
*/
public static final Set<SyntaxType> HTML_FAMILY_TYPES = SetUtils.hashSet(XHTML, HTML, ANNOTATED_XHTML,
ANNOTATED_HTML);
/**
* Plain text syntax.
*/
......
......@@ -22,9 +22,7 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.collections4.SetUtils;
import org.xwiki.rendering.internal.renderer.xhtml.image.XHTMLImageRenderer;
import org.xwiki.rendering.internal.renderer.xhtml.link.XHTMLLinkRenderer;
import org.xwiki.rendering.listener.Format;
......@@ -62,9 +60,6 @@ public class XHTMLChainingRenderer extends AbstractChainingPrintRenderer
*/
public static final String GENERATEDIDCLASS = "wikigeneratedid";
private static final Set<SyntaxType> HTML_TYPES =
SetUtils.hashSet(SyntaxType.XHTML, SyntaxType.HTML, SyntaxType.ANNOTATED_XHTML, SyntaxType.ANNOTATED_HTML);
private XHTMLLinkRenderer linkRenderer;
private XHTMLImageRenderer imageRenderer;
......@@ -591,7 +586,7 @@ public void onImage(ResourceReference reference, boolean freestanding, Map<Strin
public void onRawText(String text, Syntax syntax)
{
// Directly inject the HTML content in the wiki printer (bypassing the XHTML printer)
if (HTML_TYPES.contains(syntax.getType())) {
if (SyntaxType.HTML_FAMILY_TYPES.contains(syntax.getType())) {
getXHTMLWikiPrinter().printRaw(text);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment