Index: xwiki-rendering/xwiki-rendering-transformations/xwiki-rendering-transformation-icon/src/main/java/org/xwiki/rendering/internal/transformation/icon/IconTransformation.java
===================================================================
--- xwiki-rendering/xwiki-rendering-transformations/xwiki-rendering-transformation-icon/src/main/java/org/xwiki/rendering/internal/transformation/icon/IconTransformation.java	(revision 36424)
+++ xwiki-rendering/xwiki-rendering-transformations/xwiki-rendering-transformation-icon/src/main/java/org/xwiki/rendering/internal/transformation/icon/IconTransformation.java	(working copy)
@@ -21,6 +21,8 @@
 
 import org.xwiki.component.annotation.Component;
 import org.xwiki.component.annotation.Requirement;
+import org.xwiki.component.manager.ComponentLookupException;
+import org.xwiki.component.manager.ComponentManager;
 import org.xwiki.component.phase.Initializable;
 import org.xwiki.component.phase.InitializationException;
 import org.xwiki.rendering.block.Block;
@@ -59,24 +61,18 @@
      */
     @Requirement
     private IconTransformationConfiguration configuration;
-
+    
     /**
-     * Used to parse the mapping suite of characters into a XDOM tree for fast matching.
+     * Used to get the current syntax parser.
      */
-    @Requirement("plain/1.0")
-    private Parser plainTextParser;
+    @Requirement
+    private ComponentManager componentManager;
 
     /**
      * Used to remove the top level paragraph since we don't currently have an inline parser.
      */
     private ParserUtils parserUtils = new ParserUtils();
-
     /**
-     * The computed tree used to perform the fast mapping.
-     */
-    private XDOM mappingTree;
-
-    /**
      * Used to filter protected blocks (code macro marker block, etc).
      */
     private ProtectedBlockFilter filter = new ProtectedBlockFilter();
@@ -85,34 +81,36 @@
      * {@inheritDoc}
      * @see org.xwiki.component.phase.Initializable#initialize()
      */
-    public void initialize() throws InitializationException
-    {
-        this.mappingTree = new XDOM(Collections.<Block>emptyList());
+  public void initialize() throws InitializationException {
+  }
 
-        // Transform mappings into Blocks
-        for (Map.Entry<Object, Object> entry : this.configuration.getMappings().entrySet()) {
-            try {
-                XDOM xdom = this.plainTextParser.parse(new StringReader((String) entry.getKey()));
-                // Remove top level paragraph
-                this.parserUtils.removeTopLevelParagraph(xdom.getChildren());
-                mergeTree(this.mappingTree, convertToDeepTree(xdom, (String) entry.getValue()));
-            } catch (ParseException e) {
-                getLogger().warn("Failed to parse icon symbols [" + entry.getKey() + "]. Reason = ["
-                    + e.getMessage() + "]");
-            }
-        }
-    }
-
     /**
      * {@inheritDoc}
      * @see AbstractTransformation#transform(Block, TransformationContext)
      */
     public void transform(Block source, TransformationContext context) throws TransformationException
     {
+      try {
+        Parser iconParser = componentManager.lookup(Parser.class, context.getSyntax().toIdString());
+        XDOM mappingTree = new XDOM(Collections.<Block>emptyList());
+        for (Map.Entry<Object, Object> entry : this.configuration.getMappings().entrySet()) {
+          try {
+            XDOM xdom = iconParser.parse(new StringReader((String) entry.getKey()));
+            // Remove top level paragraph
+            this.parserUtils.removeTopLevelParagraph(xdom.getChildren());
+            mergeTree(mappingTree, convertToDeepTree(xdom, (String) entry.getValue()));
+          } catch (ParseException e) {
+            getLogger().warn("Failed to parse icon symbols [" + entry.getKey() + "]. Reason = [" + e.getMessage() + "]");
+          }
+        }
         List<Block> filteredBlocks = this.filter.filter(source.getChildren());
-        if (!this.mappingTree.getChildren().isEmpty() && !filteredBlocks.isEmpty()) {
-            parseTree(filteredBlocks);
+        if (!mappingTree.getChildren().isEmpty() && !filteredBlocks.isEmpty()) {
+          parseTree(mappingTree, filteredBlocks);
         }
+      } catch (ComponentLookupException e) {
+        getLogger().error("Failed to transform icon symbols in syntax [" + context.getSyntax().toIdString() + "]. Reason = ["
+            + e.getMessage() + "]");
+      }
     }
 
     /**
@@ -205,11 +203,11 @@
      *
      * @param sourceBlocks the blocks to parse
      */
-    private void parseTree(List<Block> sourceBlocks)
+    private void parseTree(XDOM mappingTree, List<Block> sourceBlocks)
     {
         Block matchStartBlock = null;
         int count = 0;
-        Block mappingCursor = this.mappingTree.getChildren().get(0);
+        Block mappingCursor = mappingTree.getChildren().get(0);
         Block sourceBlock = sourceBlocks.get(0);
         while (sourceBlock != null) {
             while (mappingCursor != null) {
@@ -241,10 +239,10 @@
             // Look for a match in children of the source block
             List<Block> filteredSourceBlocks = this.filter.filter(sourceBlock.getChildren());
             if (filteredSourceBlocks.size() > 0) {
-                parseTree(filteredSourceBlocks);
+                parseTree(mappingTree, filteredSourceBlocks);
             } else if (mappingCursor == null) {
                 // No match has been found, reset state variables
-                mappingCursor = this.mappingTree.getChildren().get(0);
+                mappingCursor = mappingTree.getChildren().get(0);
                 count = 0;
                 matchStartBlock = null;
             }
