maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r1030373 - in /maven/doxia/doxia-tools/trunk/doxia-linkcheck/src: main/java/org/apache/maven/doxia/linkcheck/validation/Anchors.java test/java/org/apache/maven/doxia/linkcheck/validation/AnchorsTest.java
Date Wed, 03 Nov 2010 09:28:43 GMT
Author: ltheussl
Date: Wed Nov  3 09:28:43 2010
New Revision: 1030373

URL: http://svn.apache.org/viewvc?rev=1030373&view=rev
Log:
accept upper-case html attributes

Modified:
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/Anchors.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/test/java/org/apache/maven/doxia/linkcheck/validation/AnchorsTest.java

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/Anchors.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/Anchors.java?rev=1030373&r1=1030372&r2=1030373&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/Anchors.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/Anchors.java
Wed Nov  3 09:28:43 2010
@@ -37,7 +37,7 @@ public class Anchors
     {
         if ( content != null && anchor.length() > 0 ) {
             // can use name or id attributes and also can use single or double quotes with
whitespace around the =
-            String regex = "(name|id)\\s*=\\s*('|\")" + escapeBrackets( anchor ) + "('|\")";
+            String regex = "(?i)(name|id)(?-i)\\s*=\\s*('|\")" + escapeBrackets( anchor )
+ "('|\")";
             Pattern pattern = Pattern.compile( regex );
             Matcher matcher = pattern.matcher( content );
             return matcher.find();

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/test/java/org/apache/maven/doxia/linkcheck/validation/AnchorsTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/test/java/org/apache/maven/doxia/linkcheck/validation/AnchorsTest.java?rev=1030373&r1=1030372&r2=1030373&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/test/java/org/apache/maven/doxia/linkcheck/validation/AnchorsTest.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/test/java/org/apache/maven/doxia/linkcheck/validation/AnchorsTest.java
Wed Nov  3 09:28:43 2010
@@ -42,6 +42,9 @@ public class AnchorsTest extends TestCas
             + "\n"
             + "</body>\n"
             + "</html>", "foo", true );
+
+        assertAnchorMatches( "<A NAME=\"navbar_bottom\"></A>", "navbar_bottom",
true );
+        assertAnchorMatches( "<A ID=\"navbar_bottom\"></A>", "navbar_bottom",
true );
     }
 
     protected void assertAnchorMatches( String content, String anchor, boolean expected )



Mime
View raw message