Commits

Brad Baker committed 2c6b06f

Added markdown calls to Confluence macro. Still not workable yet

Comments (0)

Files changed (3)

atlassian-confluence-markdown-plugin/pom.xml

         </dependency>
 
         <dependency>
-            <groupId>org.markdownj</groupId>
-            <artifactId>markdownj</artifactId>
-            <version>0.3.0-1.0.2b4</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.jsoup</groupId>
-            <artifactId>jsoup</artifactId>
-            <version>1.6.1</version>
+            <groupId>com.atlassian.labs</groupId>
+            <artifactId>atlassian-markdown-core</artifactId>
+            <version>${project.version}</version>
         </dependency>
 
         <dependency>

atlassian-confluence-markdown-plugin/src/main/java/com/atlassian/labs/markdown/confluence/ConfluenceMarkdownMacro.java

 package com.atlassian.labs.markdown.confluence;
 
 import com.atlassian.confluence.util.GeneralUtil;
+import com.atlassian.labs.markdown.MarkdownSanitizer;
+import com.atlassian.labs.markdown.PageDownMarkdown;
 import com.atlassian.renderer.RenderContext;
 import com.atlassian.renderer.v2.RenderMode;
 import com.atlassian.renderer.v2.macro.BaseMacro;
     @Override
     public String execute(Map parameters, String body, RenderContext renderContext) throws MacroException
     {
-        return "<div>" +
-                "<h2>This would be markdown generated</h2>" +
-                "<pre><code>" + GeneralUtil.escapeXml(body) + "</code></pre>" +
-                "</div>";
+        String markdown = new PageDownMarkdown().markdown(body);
+        return MarkdownSanitizer.sanitizeHtml(markdown);
     }
 }

atlassian-confluence-markdown-plugin/src/main/java/com/atlassian/labs/markdown/confluence/ConfluenceMarkdownXhtmlMacro.java

     }
 
     @Override
-    @RequiresFormat(Format.Storage)
     public String execute(Map<String, String> parameters, String body, ConversionContext context) throws MacroExecutionException
     {
         try