From e91e0128fd0fc5707c5763c8d8896b602cf09548 Mon Sep 17 00:00:00 2001 From: Boris Berenberg Date: Mon, 31 Jul 2017 13:26:43 -0400 Subject: [PATCH] 1.3.1 release --- fake | 1 - pom.xml | 20 ++++---- .../confluence/markdown/MarkdownMacro.java | 45 ++++++++++++++++-- src/main/resources/.DS_Store | Bin 6148 -> 6148 bytes src/main/resources/atlassian-plugin.xml | 4 -- src/main/resources/images/1pluginIcon.png | Bin 958 -> 0 bytes src/main/resources/images/1pluginLogo.png | Bin 4378 -> 0 bytes .../markdownproperties/markdown.properties | 4 +- .../markdown_de_DE.properties | 4 +- .../markdown_fr_FR.properties | 4 +- .../markdown_it_IT.properties | 1 + 11 files changed, 54 insertions(+), 29 deletions(-) delete mode 100644 fake delete mode 100644 src/main/resources/images/1pluginIcon.png delete mode 100644 src/main/resources/images/1pluginLogo.png create mode 100644 src/main/resources/markdownproperties/markdown_it_IT.properties diff --git a/fake b/fake deleted file mode 100644 index 61ce77f..0000000 --- a/fake +++ /dev/null @@ -1 +0,0 @@ -ajkdfhajksdf diff --git a/pom.xml b/pom.xml index 6fa436c..af87cba 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ com.atlassian.plugins.confluence.markdown confluence-markdown-macro - 1.2-SNAPSHOT + 1.3.1-SNAPSHOT Atlassian http://www.atlassian.com/ @@ -49,9 +49,9 @@ 2.2.2-atlassian-1 - org.pegdown - pegdown - 1.2.1 + com.vladsch.flexmark + flexmark-all + 0.22.4 @@ -76,14 +76,14 @@ - 4.3.7 - 4.3.7 - 4.2.2 + 5.9.1 + 5.9.1 + 6.2.11 1.1 - scm:git:git@bitbucket.org:atlassianlabs/markdown-macro-for-confluence.git - scm:git:git@bitbucket.org:atlassianlabs/markdown-macro-for-confluence.git - https://bitbucket.org/atlassianlabs/confluence-markdown-macro + scm:git:git@bitbucket.org:atlasauthority/markdown-macro-for-confluence.git + scm:git:git@bitbucket.org:atlasauthority/markdown-macro-for-confluence.git + https://bitbucket.org/atlasauthority/markdown-macro-for-confluence diff --git a/src/main/java/com/atlassian/plugins/confluence/markdown/MarkdownMacro.java b/src/main/java/com/atlassian/plugins/confluence/markdown/MarkdownMacro.java index 1369d5b..45e5195 100644 --- a/src/main/java/com/atlassian/plugins/confluence/markdown/MarkdownMacro.java +++ b/src/main/java/com/atlassian/plugins/confluence/markdown/MarkdownMacro.java @@ -10,6 +10,7 @@ import com.atlassian.confluence.xhtml.api.MacroDefinitionHandler; import com.atlassian.confluence.xhtml.api.XhtmlContent; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; @@ -17,8 +18,21 @@ import com.atlassian.renderer.RenderContext; import com.atlassian.renderer.v2.RenderMode; import com.atlassian.renderer.v2.macro.BaseMacro; import com.atlassian.renderer.v2.macro.MacroException; -import org.pegdown.Parser; -import org.pegdown.PegDownProcessor; + +import com.vladsch.flexmark.ast.Node; +import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughSubscriptExtension; +import com.vladsch.flexmark.ext.tables.TablesExtension; +//import com.vladsch.flexmark.ext.superscript.SuperscriptExtension; +import com.vladsch.flexmark.ext.ins.InsExtension; +import com.vladsch.flexmark.ext.definition.DefinitionExtension; +import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension; +import com.vladsch.flexmark.ext.footnotes.FootnoteExtension; +import com.vladsch.flexmark.ext.wikilink.WikiLinkExtension; +import com.vladsch.flexmark.html.HtmlRenderer; +import com.vladsch.flexmark.parser.Parser; +import com.vladsch.flexmark.util.options.MutableDataSet; + + public class MarkdownMacro extends BaseMacro implements Macro { @@ -44,9 +58,30 @@ public class MarkdownMacro extends BaseMacro implements Macro @Override public String execute(Map parameters, String bodyContent, ConversionContext conversionContext) throws MacroExecutionException { - PegDownProcessor translator = new PegDownProcessor(Parser.ALL); - String output = translator.markdownToHtml(bodyContent); - return output; + MutableDataSet options = new MutableDataSet(); + + options.set(Parser.EXTENSIONS, Arrays.asList( + TablesExtension.create(), + StrikethroughSubscriptExtension.create(), +// SuperscriptExtension.create(), + InsExtension.create(), + TaskListExtension.create(), + FootnoteExtension.create(), + WikiLinkExtension.create(), + DefinitionExtension.create() + )); + + + Parser parser = Parser.builder(options).build(); + HtmlRenderer renderer = HtmlRenderer.builder(options).build(); + + Node document = parser.parse(bodyContent); + String html = renderer.render(document); // "

This is Sparta

\n" + return html; + + //PegDownProcessor translator = new PegDownProcessor(Parser.ALL); + //String output = translator.markdownToHtml(bodyContent); + //return output; } @Override diff --git a/src/main/resources/.DS_Store b/src/main/resources/.DS_Store index 2e63a171848c56129a38a2f57650fb70dd8759b1..0a2e2d9c1936ce827a9c50834f75c22e3a6b491e 100644 GIT binary patch delta 380 zcmZoMXfc=|#>B!ku~2NHo+2ab#(>?7ixrre7+E*-FtIY$3o+y}Br+5+WHY2Nuu5=%;pof3b-Kd&S)GcUCWY&gV_$+k?A^&A|^4hbKC4q{;7 zxs9R5uQa%WCYKHG9s|Wy@C_25Vwq zWQ5QRf>0Vp9RV^3hRWuDOluf7vvcrs0K;~(AoF+T$^0UY96&RfK;~?Y5Lv?v06LXn A&Hw-a delta 68 zcmZoMXfc=|#>B)qu~2NHo+2aj#(>?7jLe&PSXdc1=dsOX+}IGyyqTSYp9837vmnQJ W=E?jbjvNd?z{tSBvN=Lz4Kn~pdJl2{ diff --git a/src/main/resources/atlassian-plugin.xml b/src/main/resources/atlassian-plugin.xml index 70521a7..ef811bf 100644 --- a/src/main/resources/atlassian-plugin.xml +++ b/src/main/resources/atlassian-plugin.xml @@ -15,8 +15,6 @@ documentation-url="http://daringfireball.net/projects/markdown/"> - - - - diff --git a/src/main/resources/images/1pluginIcon.png b/src/main/resources/images/1pluginIcon.png deleted file mode 100644 index 798d9e27dfadeab3e17d87c3faf874487f6dd036..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 958 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl47&iy_gt!8^K=AS7r!QZ=e*F0P z$%}UnpS^ka0mA(Rl=}4PGgt{0;_B6_`}gm^d-v{v0|&53GcbV6{PYEA=7VQ%-hcS~ z`SX`|@7}+E|MBg+_b*?+z4hSv`RfmF+H%%&Fi-9ubjBDtbgUY9fvpXIkxk_$&NXjqHE^H)y@elo}w4t zAmWs-;9V->RKR1KYZBeqHf{N$)mxlW+PQ6VZ4;WiXD+YnU!dq+Y8qAVoYKl-mZ9WR zmRvohsC{;R%S>L|9Mh<}^_#cv-@k9>lC?|MY??fOwXkEpR!~)B=>%opayicur{vbv z8@2(%=j4eKCr_T(wtIhM*%ZJ0{;<-?hLKHiRnzCK+_GiozN1Hv9Y22j+O_Lfu3kHS z`uxeW7xx@KRnoVzbKd4tXD?pAe*NxUpm*;dJ9D{n!S+eZcb~m@t=xp^B`~<O>_ z45UG94+giB*>*t2Cr=m05Q)pl2?;4l)6x@Dlb=7Bkp3(sB_ZL-qiNH_144qr0w+#? z{wyiw!Nbtd;OiHzT)KAg>Sgl>PZJ+JHa9UcGc+|e-?m}PCb0*}0wS9>Zrxm7P*PM@ zSXv@1lp-Kf_Wi?`Pv1U%{mjq7BgDqZ(%#b6>h9v^di=<-M%G8dLX#&22VK5oY_$0R z(@o2rl|NZq4PB3_E=_3M^r`FAs#mja?fTW`wxPizxY#>8y4pQGd@_fJgGb1k-OHD6 zUtjOkKf@xR!Qa6t$V-Z6iHd3i-{XfD*6Z!C8<`)MX5lF!N|bSNY~I%*U%`$(A3J*%*w=E z*TBrmz+i>U!6hgfa`RI%(<*Umxan9a0n{J~vLQG>t)x7$D3!r6B|j-u!8128JvAsb WF{QHbWU38N5re0zpUXO@geCw9n!?Ed diff --git a/src/main/resources/images/1pluginLogo.png b/src/main/resources/images/1pluginLogo.png deleted file mode 100644 index 48143eca83d696eb73f4c99895799c17aea710a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4378 zcmZ{oWmMG7-^PDSF5Mu#G)gTCC>_$>9n#&6z|B$;D@dnw!-8}pEe%VEAR;9Q0@986 z=f2-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KHh Iy|j$@A43lXD*ylh diff --git a/src/main/resources/markdownproperties/markdown.properties b/src/main/resources/markdownproperties/markdown.properties index b1b5302..6ead454 100644 --- a/src/main/resources/markdownproperties/markdown.properties +++ b/src/main/resources/markdownproperties/markdown.properties @@ -1,3 +1 @@ -com.atlassian.plugins.confluence.markdown.confluence-markdown-macro.markdown.desc=This macro renders text in Markdown syntax into HTML. -com.atlassian.plugins.confluence.markdown.confluence-markdown-macro.markdown.param.extended.label=Enable extended Markdown properties: -com.atlassian.plugins.confluence.markdown.confluence-markdown-macro.markdown.param.extended.desc=Find info about extended Markdown at: https://github.com/sirthias/pegdown#readme \ No newline at end of file +com.atlassian.plugins.confluence.markdown.confluence-markdown-macro.markdown.desc=This macro renders Markdown into HTML. \ No newline at end of file diff --git a/src/main/resources/markdownproperties/markdown_de_DE.properties b/src/main/resources/markdownproperties/markdown_de_DE.properties index 247e086..e7d29ed 100644 --- a/src/main/resources/markdownproperties/markdown_de_DE.properties +++ b/src/main/resources/markdownproperties/markdown_de_DE.properties @@ -1,3 +1 @@ -com.atlassian.plugins.confluence.markdown.confluence-markdown-macro.markdown.desc=Dieses Makro wandelt Markdown in HTML um. -com.atlassian.plugins.confluence.markdown.confluence-markdown-macro.markdown.param.extended.label=Aktivieren sich weiter Eigenschaften Markdown: -com.atlassian.plugins.confluence.markdown.confluence-markdown-macro.markdown.param.extended.desc=Befindet sich information \u00FCber Extended Markdown: https://github.com/sirthias/pegdown#readme \ No newline at end of file +com.atlassian.plugins.confluence.markdown.confluence-markdown-macro.markdown.desc=Dieses Makro wandelt Markdown in HTML um. \ No newline at end of file diff --git a/src/main/resources/markdownproperties/markdown_fr_FR.properties b/src/main/resources/markdownproperties/markdown_fr_FR.properties index c6ae523..70ebc42 100644 --- a/src/main/resources/markdownproperties/markdown_fr_FR.properties +++ b/src/main/resources/markdownproperties/markdown_fr_FR.properties @@ -1,3 +1 @@ -com.atlassian.plugins.confluence.markdown.confluence-markdown-macro.markdown.desc=Ce macro converti le text format\u00E9 selon Markdown vers HTML -com.atlassian.plugins.confluence.markdown.confluence-markdown-macro.markdown.param.extended.label=Activez les propri\u00E9t\u00E9s avanc\u00E9es de Markdown:Pour plus d'information sur -com.atlassian.plugins.confluence.markdown.confluence-markdown-macro.markdown.param.extended.desc=Pour plus d'information sur les propri\u00E9t\u00E9s avanc\u00E9es de Markdown: https://github.com/sirthias/pegdown#readme \ No newline at end of file +com.atlassian.plugins.confluence.markdown.confluence-markdown-macro.markdown.desc=Ce macro converti Markdown vers HTML \ No newline at end of file diff --git a/src/main/resources/markdownproperties/markdown_it_IT.properties b/src/main/resources/markdownproperties/markdown_it_IT.properties new file mode 100644 index 0000000..f738379 --- /dev/null +++ b/src/main/resources/markdownproperties/markdown_it_IT.properties @@ -0,0 +1 @@ +com.atlassian.plugins.confluence.markdown.confluence-markdown-macro.markdown.desc=Ce macro converti le text format\u00E9 selon Markdown vers HTML \ No newline at end of file