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/07/22 18:08:11 UTC

[maven-doxia] branch DOXIA-664 created (now a2b5559d)

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

michaelo pushed a change to branch DOXIA-664
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git


      at a2b5559d [DOXIA-664] Upgrade Flexmark to 0.62.2

This branch includes the following new commits:

     new a2b5559d [DOXIA-664] Upgrade Flexmark to 0.62.2

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-doxia] 01/01: [DOXIA-664] Upgrade Flexmark to 0.62.2

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch DOXIA-664
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git

commit a2b5559d72ef37a4ac587ee2bff360d321f325cc
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Fri Jul 22 20:08:02 2022 +0200

    [DOXIA-664] Upgrade Flexmark to 0.62.2
---
 doxia-modules/doxia-module-markdown/pom.xml            |  8 +++++++-
 .../module/markdown/FlexmarkDoxiaLinkResolver.java     | 18 +++++++++++-------
 .../doxia/module/markdown/MarkdownParserTest.java      |  2 +-
 3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/doxia-modules/doxia-module-markdown/pom.xml b/doxia-modules/doxia-module-markdown/pom.xml
index f576f406..41ee0377 100644
--- a/doxia-modules/doxia-module-markdown/pom.xml
+++ b/doxia-modules/doxia-module-markdown/pom.xml
@@ -63,7 +63,8 @@ under the License.
     <dependency>
       <groupId>com.vladsch.flexmark</groupId>
       <artifactId>flexmark-all</artifactId>
-      <version>0.50.50</version>
+      <!-- 0.64.0 requires Java 11 -->
+      <version>0.62.2</version>
       <exclusions>
         <!-- exclude to PDF converter -->
         <exclusion>
@@ -72,6 +73,11 @@ under the License.
         </exclusion>
       </exclusions>
     </dependency>
+    <dependency>
+      <groupId>org.jetbrains</groupId>
+      <artifactId>annotations</artifactId>
+      <version>15.0</version>
+    </dependency>
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
       <artifactId>doxia-module-xhtml5</artifactId>
diff --git a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaLinkResolver.java b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaLinkResolver.java
index 91929d0a..9b97ecdd 100644
--- a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaLinkResolver.java
+++ b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaLinkResolver.java
@@ -24,11 +24,13 @@ import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
 import com.vladsch.flexmark.ext.wikilink.internal.WikiLinkLinkResolver;
 import com.vladsch.flexmark.html.IndependentLinkResolverFactory;
 import com.vladsch.flexmark.html.LinkResolver;
-import com.vladsch.flexmark.html.LinkResolverFactory;
-import com.vladsch.flexmark.html.renderer.LinkResolverContext;
+import com.vladsch.flexmark.html.renderer.LinkResolverBasicContext;
 import com.vladsch.flexmark.html.renderer.LinkStatus;
 import com.vladsch.flexmark.html.renderer.LinkType;
 import com.vladsch.flexmark.html.renderer.ResolvedLink;
@@ -62,7 +64,7 @@ public class FlexmarkDoxiaLinkResolver implements LinkResolver
      *
      * @param context a {@link com.vladsch.flexmark.html.renderer.LinkResolverContext} object.
      */
-    public FlexmarkDoxiaLinkResolver( LinkResolverContext context )
+    public FlexmarkDoxiaLinkResolver( @NotNull LinkResolverBasicContext context )
     {
         this.pattern = Pattern.compile(
                             "^(?![^:]+:)((?:\\./)?(?:\\.\\./)*[^\\.]+).(?:"
@@ -75,7 +77,8 @@ public class FlexmarkDoxiaLinkResolver implements LinkResolver
 
     /** {@inheritDoc} */
     @Override
-    public ResolvedLink resolveLink( Node node, LinkResolverContext context, ResolvedLink link )
+    public @NotNull ResolvedLink resolveLink( @NotNull Node node, @NotNull LinkResolverBasicContext context,
+                                              @NotNull ResolvedLink link )
     {
         if ( link.getLinkType() == LinkType.LINK )
         {
@@ -95,17 +98,18 @@ public class FlexmarkDoxiaLinkResolver implements LinkResolver
     public static class Factory extends IndependentLinkResolverFactory
     {
         @Override
-        public Set<Class<? extends LinkResolverFactory>> getBeforeDependents()
+        public @Nullable Set<Class<?>> getBeforeDependents()
         {
-            Set<Class<? extends LinkResolverFactory>> set = new HashSet<>();
+            Set<Class<?>> set = new HashSet<>();
             set.add( WikiLinkLinkResolver.Factory.class );
             return set;
         }
 
         @Override
-        public LinkResolver apply( LinkResolverContext context )
+        public @NotNull LinkResolver apply( @NotNull LinkResolverBasicContext context )
         {
             return new FlexmarkDoxiaLinkResolver( context );
         }
     }
+
 }
diff --git a/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java b/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java
index 8519fe38..7887f0bd 100644
--- a/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java
+++ b/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java
@@ -394,7 +394,7 @@ public class MarkdownParserTest
                 "horizontalRule", "section1", "sectionTitle1",  "text", "sectionTitle1_", "paragraph", "text",
                 "paragraph_", "text", "table", "tableRows", "text", "tableRow", "tableHeaderCell", "text",
                 "tableHeaderCell_", "tableRow_", "text", "tableRow", "tableCell", "text", "tableCell_", "tableRow_",
-                "text", "tableRows_", "table_", "section1_", "body_" );
+                "text", "tableRows_", "table_", "text", "section1_", "body_" );
 
         assertFalse( it.hasNext() );
     }