Removed URL parameter and updated MarkdownMacro.java to get URL from bodyContent.
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -90,6 +90,8 @@
|
||||
<configuration>
|
||||
<productVersion>${confluence.version}</productVersion>
|
||||
<productDataVersion>${confluence.data.version}</productDataVersion>
|
||||
<enableQuickReload>true</enableQuickReload>
|
||||
<enableFastdev>false</enableFastdev>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@@ -105,14 +105,13 @@ public class MarkdownMacro extends BaseMacro implements Macro
|
||||
" });\n" +
|
||||
"</script>";
|
||||
|
||||
Parser parser = Parser.builder(options).build();
|
||||
HtmlRenderer renderer = HtmlRenderer.builder(options).build();
|
||||
if (bodyContent != null) {
|
||||
Parser parser = Parser.builder(options).build();
|
||||
HtmlRenderer renderer = HtmlRenderer.builder(options).build();
|
||||
|
||||
String toParse = bodyContent;
|
||||
if (parameters.get("URL") != null) {
|
||||
String toParse = "";
|
||||
try {
|
||||
String urlParam = parameters.get("URL");
|
||||
URL importFrom = new URL(urlParam);
|
||||
URL importFrom = new URL(bodyContent);
|
||||
BufferedReader in = new BufferedReader(
|
||||
new InputStreamReader(importFrom.openStream())
|
||||
);
|
||||
@@ -124,10 +123,13 @@ public class MarkdownMacro extends BaseMacro implements Macro
|
||||
in.close();
|
||||
}
|
||||
catch (IOException e) {}
|
||||
}
|
||||
Node document = parser.parse(toParse);
|
||||
String html = renderer.render(document) + highlightjs;
|
||||
return html;
|
||||
|
||||
Node document = parser.parse(toParse);
|
||||
String html = renderer.render(document) + highlightjs;
|
||||
return html;
|
||||
}else {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,7 @@
|
||||
icon="/download/resources/com.atlassian.plugins.confluence.markdown.confluence-markdown-macro/images/pluginIcon.png"
|
||||
documentation-url="https://spec.commonmark.org/0.28/">
|
||||
<category name="formatting"/>
|
||||
<parameters>
|
||||
<parameter name="URL" type="string" />
|
||||
</parameters>
|
||||
</xhtml-macro>
|
||||
<parameters />
|
||||
<macro name="markdown"
|
||||
class="com.atlassian.plugins.confluence.markdown.MarkdownMacro"
|
||||
key="markdown.wiki"
|
||||
|
||||
Reference in New Issue
Block a user