You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2022/12/29 11:06:21 UTC

[maven-doxia] 02/03: [DOXIA-650] Make MarkdownParser to be a text parser with text markup

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch doxia-1.x
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git

commit ceb77298f6eb362eee86c76f678cc7d60a710055
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Fri May 27 21:25:13 2022 +0200

    [DOXIA-650] Make MarkdownParser to be a text parser with text markup
---
 .../maven/doxia/module/markdown/MarkdownParser.java     | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

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 33057eaf..a066c508 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
@@ -36,8 +36,9 @@ 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.markup.TextMarkup;
 import org.apache.maven.doxia.module.xhtml.XhtmlParser;
-import org.apache.maven.doxia.parser.AbstractParser;
+import org.apache.maven.doxia.parser.AbstractTextParser;
 import org.apache.maven.doxia.parser.ParseException;
 import org.apache.maven.doxia.parser.Parser;
 import org.apache.maven.doxia.sink.Sink;
@@ -69,7 +70,8 @@ import java.util.regex.Pattern;
  */
 @Component( role = Parser.class, hint = MarkdownParser.ROLE_HINT )
 public class MarkdownParser
-    extends AbstractParser
+    extends AbstractTextParser
+    implements TextMarkup
 {
 
     /**
@@ -98,17 +100,6 @@ public class MarkdownParser
             "^[ \\t]*([^:\\r\\n]+?)[ \\t]*:[ \\t]*([^\\r\\n]*)[ \\t]*$",
             Pattern.MULTILINE );
 
-    /**
-     * <p>getType.</p>
-     *
-     * @return a int.
-     */
-    @Override
-    public int getType()
-    {
-        return TXT_TYPE;
-    }
-
     /**
      * The parser of the HTML produced by Flexmark, that we will
      * use to convert this HTML to Sink events