NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 476 - v.nu should report an error for Simon's "just a hash" test
v.nu should report an error for Simon's "just a hash" test
Status: RESOLVED DUPLICATE of bug 323
Product: Validator.nu
Classification: Unclassified
Component: Test cases
HEAD
All All
: P2 normal
Assigned To: Michael[tm] Smith
http://simon.html5.org/test/validator...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-07 06:20 CEST by Michael[tm] Smith
Modified: 2009-04-07 16:02 CEST (History)
2 users (show)

See Also:


Attachments
patch to datatype/HashName.java file (635 bytes, patch)
2009-04-07 07:38 CEST, Michael[tm] Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael[tm] Smith 2009-04-07 06:20:28 CEST
v.nu reports no error for http://simon.html5.org/test/validator/attribute-values/img-usemap/just-a-hash.html but should, since there's no way a usemap value can be a "valid hash-name reference" unless there's at least one character in that value after the hash. Seems like the HashName.java datatype checker for common.data.hash-name needs to be made more strict. Maybe the following?

Index: HashName.java
===================================================================
--- HashName.java       (revision 404)
+++ HashName.java       (working copy)
@@ -44,6 +44,8 @@
             throw newDatatypeException("The empty string is not a valid hash-name reference.");
         } else if (literal.charAt(0) != '#') {
             throw newDatatypeException("A hash-name reference must start with \u201C#\u201D.");
+        } else if (literal.length() == 1) {
+            throw newDatatypeException("A hash-name reference must have at least one character after \u201C#\u201D.");
         }
         // Other cases
     }
Comment 1 Michael[tm] Smith 2009-04-07 07:38:21 CEST
Created attachment 75 [details]
patch to datatype/HashName.java file
Comment 2 Michael[tm] Smith 2009-04-07 16:02:02 CEST

*** This bug has been marked as a duplicate of bug 323 ***