You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/01/08 17:36:39 UTC
[maven-doxia] 02/03: [DOXIA-635] Drop and replace usage of Commons IO in Markdown Module
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch dependency-cleanup
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git
commit 6f92d3fd373821ab5f6159b82366c40b56182ab4
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Jan 8 18:35:47 2022 +0100
[DOXIA-635] Drop and replace usage of Commons IO in Markdown Module
---
doxia-modules/doxia-module-markdown/pom.xml | 4 ----
.../org/apache/maven/doxia/module/markdown/MarkdownParser.java | 9 ++++-----
pom.xml | 7 -------
3 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/doxia-modules/doxia-module-markdown/pom.xml b/doxia-modules/doxia-module-markdown/pom.xml
index 24b2f20..c696681 100644
--- a/doxia-modules/doxia-module-markdown/pom.xml
+++ b/doxia-modules/doxia-module-markdown/pom.xml
@@ -73,10 +73,6 @@ under the License.
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
diff --git a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownParser.java b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownParser.java
index 33057ea..1ac7508 100644
--- a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownParser.java
+++ b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownParser.java
@@ -34,7 +34,6 @@ import com.vladsch.flexmark.ext.tables.TablesExtension;
import com.vladsch.flexmark.ext.wikilink.WikiLinkExtension;
import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension;
-import org.apache.commons.io.input.CharSequenceReader;
import org.apache.maven.doxia.markup.HtmlMarkup;
import org.apache.maven.doxia.module.xhtml.XhtmlParser;
import org.apache.maven.doxia.parser.AbstractParser;
@@ -169,10 +168,10 @@ public class MarkdownParser
try
{
// Markdown to HTML (using flexmark-java library)
- CharSequence html = toHtml( source );
+ String html = toHtml( source );
// then HTML to Sink API
- parser.parse( new CharSequenceReader( html ), sink );
+ parser.parse( html, sink );
}
catch ( IOException e )
{
@@ -187,7 +186,7 @@ public class MarkdownParser
* @return HTML content generated by flexmark-java
* @throws IOException passed through
*/
- CharSequence toHtml( Reader source )
+ String toHtml( Reader source )
throws IOException
{
// Read the source
@@ -264,7 +263,7 @@ public class MarkdownParser
html.append( "</body>" );
html.append( "</html>" );
- return html;
+ return html.toString();
}
/**
diff --git a/pom.xml b/pom.xml
index 88c131e..7c31177 100644
--- a/pom.xml
+++ b/pom.xml
@@ -178,13 +178,6 @@ under the License.
<version>3.3.0</version>
</dependency>
- <!-- Apache Commons IO -->
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.6</version>
- </dependency>
-
<!-- SLF4J -->
<dependency>
<groupId>org.slf4j</groupId>