File tree Expand file tree Collapse file tree 2 files changed +16
-11
lines changed
src/main/java/org/scijava/plugins/text/markdown Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 55 <parent >
66 <groupId >org.scijava</groupId >
77 <artifactId >pom-scijava</artifactId >
8- <version >26.0.0 </version >
8+ <version >29.2.1 </version >
99 <relativePath />
1010 </parent >
1111
@@ -84,6 +84,8 @@ Wisconsin-Madison.</license.copyrightOwners>
8484
8585 <!-- NB: Deploy releases to the SciJava Maven repository. -->
8686 <releaseProfiles >deploy-to-scijava</releaseProfiles >
87+
88+ <flexmark .version>0.62.2</flexmark .version>
8789 </properties >
8890
8991 <dependencies >
@@ -95,9 +97,9 @@ Wisconsin-Madison.</license.copyrightOwners>
9597
9698 <!-- Third-party dependencies -->
9799 <dependency >
98- <groupId >org.markdownj </groupId >
99- <artifactId >markdownj </artifactId >
100- <version >0.3.0-1.0.2b4 </version >
100+ <groupId >com.vladsch.flexmark </groupId >
101+ <artifactId >flexmark-all </artifactId >
102+ <version >${flexmark.version} </version >
101103 </dependency >
102104
103105 <!-- Test scope dependencies -->
Original file line number Diff line number Diff line change 3030
3131package org .scijava .plugins .text .markdown ;
3232
33- import com .petebevin .markdown .MarkdownProcessor ;
34-
33+ import com .vladsch .flexmark .util .ast .Node ;
34+ import com .vladsch .flexmark .html .HtmlRenderer ;
35+ import com .vladsch .flexmark .parser .Parser ;
3536import java .util .Arrays ;
3637import java .util .List ;
37-
3838import org .scijava .plugin .Plugin ;
3939import org .scijava .text .AbstractTextFormat ;
4040import org .scijava .text .TextFormat ;
4141
4242/**
43- * Text format for <a
44- * href="http://daringfireball.net/projects/markdown/">Markdown</a>.
43+ * Text format for
44+ * <a href="http://daringfireball.net/projects/markdown/">Markdown</a>.
4545 *
4646 * @author Curtis Rueden
4747 */
@@ -55,8 +55,11 @@ public List<String> getExtensions() {
5555
5656 @ Override
5757 public String asHTML (final String text ) {
58- final MarkdownProcessor markdown = new MarkdownProcessor ();
59- return markdown .markdown (text );
58+ Parser parser = Parser .builder ().build ();
59+ HtmlRenderer renderer = HtmlRenderer .builder ().build ();
60+
61+ Node node = parser .parse (text );
62+ return renderer .render (node );
6063 }
6164
6265}
You can’t perform that action at this time.
0 commit comments