Skip to content

Commit

Permalink
Merge pull request #7 from SBI-/master
Browse files Browse the repository at this point in the history
Correctly display tables in rich hover and improve styling
  • Loading branch information
SBI- authored Jun 29, 2018
2 parents 542ac44 + 5354371 commit cb7ab7a
Show file tree
Hide file tree
Showing 12 changed files with 782 additions and 57 deletions.
2 changes: 1 addition & 1 deletion feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="org.jazzcommunity.GitConnectorService.feature"
label="REST Service"
version="1.5.0.qualifier"
version="1.5.1.qualifier"
provider-name="PROVIDER">

<description url="http://www.example.com/description">
Expand Down
2 changes: 1 addition & 1 deletion feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.jazzcommunity.GitConnectorService</groupId>
<artifactId>org.jazzcommunity.GitConnectorService.parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>1.5.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

Expand Down
3 changes: 2 additions & 1 deletion plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: org.jazzcommunity.GitConnectorService
Bundle-SymbolicName: org.jazzcommunity.GitConnectorService;singleton:=true
Bundle-Version: 1.5.0.qualifier
Bundle-Version: 1.5.1.qualifier
Bundle-Vendor: VENDOR
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle:
Expand Down Expand Up @@ -49,6 +49,7 @@ Bundle-ClassPath: target/dependency/gson-2.8.2.jar,
target/dependency/parboiled-java-1.1.7.jar,
target/dependency/minigit-1.0.0-SNAPSHOT.jar,
target/dependency/commonmark-0.11.0.jar,
target/dependency/commonmark-ext-gfm-tables-0.11.0.jar,
target/dependency/modelmapper-2.0.0.jar,
target/dependency/threetenbp-1.3.6.jar,
target/java-gen,
Expand Down
2 changes: 1 addition & 1 deletion plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.jazzcommunity.GitConnectorService</groupId>
<artifactId>org.jazzcommunity.GitConnectorService.parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>1.5.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
package org.jazzcommunity.GitConnectorService.html;

import org.commonmark.Extension;
import org.commonmark.node.Node;
import org.commonmark.parser.Parser;
import org.commonmark.renderer.html.HtmlRenderer;
import org.commonmark.ext.gfm.tables.TablesExtension;

import java.util.Arrays;
import java.util.List;

public class MarkdownParser {
public static String toHtml(String markdown) {
if (markdown == null) {
return "";
}
Parser parser = Parser.builder().build();

List<Extension> extensions = Arrays.asList(TablesExtension.create());

Parser parser = Parser
.builder()
.extensions(extensions)
.build();

Node document = parser.parse(markdown);
HtmlRenderer renderer = HtmlRenderer.builder().build();

HtmlRenderer renderer = HtmlRenderer
.builder()
.extensions(extensions)
.build();


return renderer.render(document);
}
}
Loading

0 comments on commit cb7ab7a

Please sign in to comment.