[maven-doxia] branch master updated: [DOXIA-523] Ampersands after hash in markdown link syntax are now throwing parse errors.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[maven-doxia] branch master updated: [DOXIA-523] Ampersands after hash in markdown link syntax are now throwing parse errors.

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 76513d0  [DOXIA-523] Ampersands after hash in markdown link syntax are now throwing parse errors.
76513d0 is described below

commit 76513d04cd59145b5faba17218335c35c9582c2d
Author: rfscholte <[hidden email]>
AuthorDate: Sun Dec 3 21:15:40 2017 +0100

    [DOXIA-523] Ampersands after hash in markdown link syntax are now throwing parse errors.
---
 .../maven/doxia/module/markdown/MarkdownParserTest.java | 17 ++++++++++++++---
 .../src/test/resources/link_anchor_query.md             |  1 +
 2 files changed, 15 insertions(+), 3 deletions(-)

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 9124015..e1b2016 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
@@ -1,5 +1,8 @@
 package org.apache.maven.doxia.module.markdown;
 
+import java.io.Reader;
+import java.util.Iterator;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -22,13 +25,12 @@ package org.apache.maven.doxia.module.markdown;
 import org.apache.maven.doxia.parser.AbstractParserTest;
 import org.apache.maven.doxia.parser.ParseException;
 import org.apache.maven.doxia.parser.Parser;
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
 import org.apache.maven.doxia.sink.impl.SinkEventElement;
 import org.apache.maven.doxia.sink.impl.SinkEventTestingSink;
 import org.codehaus.plexus.util.IOUtil;
 
-import java.io.Reader;
-import java.util.Iterator;
-
 /**
  * Tests for {@link MarkdownParser}.
  *
@@ -162,6 +164,15 @@ public class MarkdownParserTest
 
         assertFalse( it.hasNext() );
     }
+    
+    public void testLinkWithAnchorAndQuery() throws Exception
+    {
+        Iterator<SinkEventElement> it = parseFileToEventTestingSink( "link_anchor_query" ).getEventList().iterator();
+        
+        assertEquals( it, "head", "head_", "body", "paragraph", "link", "text", "link_", "paragraph_", "body_" );
+
+        assertFalse( it.hasNext() );
+    }
 
     /**
      * Assert the list sink event is fired when parsing "list.md".
diff --git a/doxia-modules/doxia-module-markdown/src/test/resources/link_anchor_query.md b/doxia-modules/doxia-module-markdown/src/test/resources/link_anchor_query.md
new file mode 100644
index 0000000..4a484cb
--- /dev/null
+++ b/doxia-modules/doxia-module-markdown/src/test/resources/link_anchor_query.md
@@ -0,0 +1 @@
+[This is a link with an ampersand](http://www.example.com?query#obj=foo&id=bar)
\ No newline at end of file

--
To stop receiving notification emails like this one, please contact
['"[hidden email]" <[hidden email]>'].