Giter VIP home page Giter VIP logo

validator.github.io's Introduction

validator.github.io's People

Contributors

jacobq avatar sideshowbarker avatar xhmikosr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

validator.github.io's Issues

Exited with 0 on error

I try to use the Validator on Travis. My script is simple:

script:
  - "wget -O vnu.zip https://github.com/validator/validator.github.io/releases/download/20140222/vnu-20140222.zip"
  - "unzip vnu.zip"
  - "java -jar ./vnu/vnu.jar index.html"

Validator tells me what’s wrong with my invalid file:

"file:/home/travis/build/penibelst/jekyll-noita/index.html":5.1-5.1: error: Non-space characters found without seeing a doctype first. Expected “<!DOCTYPE html>”.
"file:/home/travis/build/penibelst/jekyll-noita/index.html":5.1-5.1: error: XHTML element “head” is missing a required instance of child element “title”.

But then I see:

The command "java -jar ./vnu/vnu.jar index.html" exited with 0.

I expect a non-zero return code on errors. Does vnu.jar always return zero? Is there any option for make it scream on errors?

I’m not familiar with Java, so maybe my command is wrong.

Frequent OutOfMemoryError errors

When I run this repeatedly, about one in three times I get this OutOfMemoryError.
The file I'm testing against is this: https://www.dropbox.com/s/uin00m2c5bvmzyt/test_render_not_valid-16.html?dl=0

$ java -jar /Users/peterbe/Downloads/vnu/vnu.jar /var/folders/l7/9ffkzwg965gf0zl261g34n_m0000gp/T/outputtestingclient/test_render_not_valid-16.html
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
    at java.nio.ByteBuffer.allocate(ByteBuffer.java:331)
    at sun.nio.cs.StreamDecoder.<init>(StreamDecoder.java:250)
    at sun.nio.cs.StreamDecoder.<init>(StreamDecoder.java:230)
    at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:69)
    at java.io.InputStreamReader.<init>(InputStreamReader.java:100)
    at java.util.ServiceLoader.parse(ServiceLoader.java:297)
    at java.util.ServiceLoader.access$200(ServiceLoader.java:181)
    at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:349)
    at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:439)
    at java.nio.charset.Charset$1.getNext(Charset.java:355)
    at java.nio.charset.Charset$1.hasNext(Charset.java:370)
    at java.nio.charset.Charset$2.run(Charset.java:413)
    at java.nio.charset.Charset$2.run(Charset.java:411)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.nio.charset.Charset.lookupViaProviders(Charset.java:410)
    at java.nio.charset.Charset.lookup2(Charset.java:487)
    at java.nio.charset.Charset.lookup(Charset.java:475)
    at java.nio.charset.Charset.isSupported(Charset.java:517)
    at com.ibm.icu.charset.CharsetProviderICU.getJavaCanonicalName(CharsetProviderICU.java:225)
    at com.ibm.icu.charset.CharsetProviderICU.getCharset(CharsetProviderICU.java:149)
    at com.ibm.icu.charset.CharsetProviderICU.putCharsets(CharsetProviderICU.java:291)
    at com.ibm.icu.charset.CharsetProviderICU.charsets(CharsetProviderICU.java:308)
    at java.nio.charset.Charset$4.run(Charset.java:593)
    at java.nio.charset.Charset$4.run(Charset.java:585)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.nio.charset.Charset.availableCharsets(Charset.java:584)
    at nu.validator.htmlparser.io.Encoding.<clinit>(Encoding.java:104)
    at nu.validator.htmlparser.io.MetaSniffer.tryCharset(MetaSniffer.java:147)
    at nu.validator.htmlparser.impl.MetaScanner.handleTagInner(MetaScanner.java:819)
    at nu.validator.htmlparser.impl.MetaScanner.handleTag(MetaScanner.java:809)
    at nu.validator.htmlparser.impl.MetaScanner.stateLoop(MetaScanner.java:507)

Version here:

$ java -jar /Users/peterbe/Downloads/vnu/vnu.jar --version
20140901

Use Jekyll

The master branch is run through Jekyll when you push content to your repository. With this in mind you could simplify the maintenance of documentation. I’ve created an example:

  • Repo. Note changes in
    • _layouts
    • _config.yml
    • example.md
    • README.md
  • Live.

XHTML errors when parsing HTML5

If I use the validator jar on the command line for parsing HTML5 files (local or URL based), I get a XHTML error:

java -jar ~/software/vnu/vnu/vnu.jar --html /software/vnu/vnu/index.html
"file:
/software/vnu/vnu/index.html":140.23-140.23: error: XHTML element “style” not allowed as child of XHTML element “p” in this context. (Suppressing further errors from this subtree.)

If instead I run using the http client against a locally running standalone vnu instance I get an error which doesn't reference XHTML:

java -cp ~/software/vnu/vnu/vnu.jar nu.validator.client.HttpClient /software/vnu/vnu/index.html
"
/software/vnu/vnu/index.html":140.1-140.23: error: Element "style" not allowed as child of element "p" in this context. (Suppressing further errors from this subtree.)

Why the difference in error reporting?

Detecting orphan attributes that should point to another element with an attribute of type ID

Hi Michael,

It seems that the validator does not detect all the orphan attributes that should point to another element with an attribute of type ID.

For instance, this gist:

https://gist.github.com/cavweb20/d3d5b2e457bce4b603bd

does not throw any error.

We have compiled (@cleancoderocker) a list of the relevant HTML 5 attributes, in case it helps you:

https://github.com/webcc/wcag20/wiki/HTML5-attributes-pointing-to-elements-with-ID

--format does not work in latest release

There seems to be a bug in the latest release with --format flag.

Test file: https://gist.github.com/cavweb20/a24915082675227cc65a#file-gistfile1-html

Running:

java -jar vnu.jar test_01.html

gives correctly:

"file:test_01.html":9.12-9.12: error: The element “header” must not appear as a descendant of the “footer” element.

But:

java -jar vnu.jar --format json test_01.html

gives an exception:

"file:test_01.html":-1:-1: warning: Illegal state for callback.
Exception in thread "main" org.xml.sax.SAXException: Illegal state for callback.
        at nu.validator.json.Serializer.endObject(Serializer.java:227)
        at nu.validator.messages.JsonMessageEmitter.endMessages(JsonMessageEmitter.java:107)
        at nu.validator.messages.MessageEmitterAdapter.end(MessageEmitterAdapter.java:639)
        at nu.validator.client.SimpleCommandLineValidator.end(SimpleCommandLineValidator.java:205)
        at nu.validator.client.SimpleCommandLineValidator.main(SimpleCommandLineValidator.java:175)

Also:

java -jar vnu.jar --format xml test_01.html

gives an exception:

Exception in thread "main" java.util.NoSuchElementException
        at java.util.LinkedList.getFirst(LinkedList.java:242)
        at nu.validator.htmlparser.sax.XmlSerializer.startPrefixMappingPrivate(XmlSerializer.java:728)
        at nu.validator.htmlparser.sax.XmlSerializer.startElement(XmlSerializer.java:554)
        at nu.validator.messages.XmlSaxEmitter.startElement(XmlSaxEmitter.java:49)
        at nu.validator.messages.XmlMessageEmitter.startMessage(XmlMessageEmitter.java:92)
        at nu.validator.messages.MessageEmitterAdapter.startMessage(MessageEmitterAdapter.java:1575)
        at nu.validator.messages.MessageEmitterAdapter.messageWithoutExtract(MessageEmitterAdapter.java:798)
        at nu.validator.messages.MessageEmitterAdapter.message(MessageEmitterAdapter.java:731)
        at nu.validator.messages.MessageEmitterAdapter.messageFromSAXParseException(MessageEmitterAdapter.java:698)
        at nu.validator.messages.MessageEmitterAdapter.error(MessageEmitterAdapter.java:507)
        at nu.validator.messages.MessageEmitterAdapter.error(MessageEmitterAdapter.java:469)
        at org.whattf.checker.Checker.err(Checker.java:106)
        at org.whattf.checker.schematronequiv.Assertions.startElement(Assertions.java:1584)
        at com.thaiopensource.xml.sax.ForkContentHandler.startElement(Unknown Source)
        at com.thaiopensource.xml.sax.ForkContentHandler.startElement(Unknown Source)
        at com.thaiopensource.xml.sax.ForkContentHandler.startElement(Unknown Source)
        at com.thaiopensource.xml.sax.ForkContentHandler.startElement(Unknown Source)
        at com.thaiopensource.xml.sax.ForkContentHandler.startElement(Unknown Source)
        at com.thaiopensource.xml.sax.ForkContentHandler.startElement(Unknown Source)
        at com.thaiopensource.xml.sax.ForkContentHandler.startElement(Unknown Source)
        at com.thaiopensource.xml.sax.ForkContentHandler.startElement(Unknown Source)
        at com.thaiopensource.xml.sax.ForkContentHandler.startElement(Unknown Source)
        at com.thaiopensource.xml.sax.ForkContentHandler.startElement(Unknown Source)
        at nu.validator.htmlparser.sax.SAXStreamer.elementPushed(SAXStreamer.java:146)
        at nu.validator.htmlparser.sax.SAXStreamer.elementPushed(SAXStreamer.java:35)
        at nu.validator.htmlparser.impl.TreeBuilder.push(TreeBuilder.java:4505)
        at nu.validator.htmlparser.impl.TreeBuilder.appendToCurrentNodeAndPushElementMayFoster(TreeBuilder.java:5248)
        at nu.validator.htmlparser.impl.TreeBuilder.startTag(TreeBuilder.java:2058)
        at nu.validator.htmlparser.impl.Tokenizer.emitCurrentTagToken(Tokenizer.java:1138)
        at nu.validator.htmlparser.impl.Tokenizer.stateLoop(Tokenizer.java:1653)
        at nu.validator.htmlparser.impl.Tokenizer.tokenizeBuffer(Tokenizer.java:1351)
        at nu.validator.htmlparser.io.Driver.runStates(Driver.java:302)
        at nu.validator.htmlparser.io.Driver.tokenize(Driver.java:219)
        at nu.validator.htmlparser.sax.HtmlParser.tokenize(HtmlParser.java:480)
        at nu.validator.htmlparser.sax.HtmlParser.parse(HtmlParser.java:423)
        at nu.validator.validation.SimpleDocumentValidator.checkAsHTML(SimpleDocumentValidator.java:320)
        at nu.validator.validation.SimpleDocumentValidator.checkHtmlFile(SimpleDocumentValidator.java:277)
        at nu.validator.client.SimpleCommandLineValidator.checkHtmlFile(SimpleCommandLineValidator.java:266)
        at nu.validator.client.SimpleCommandLineValidator.checkFiles(SimpleCommandLineValidator.java:218)
        at nu.validator.client.SimpleCommandLineValidator.main(SimpleCommandLineValidator.java:174)

MessageEmitterAdapter.setHtml(true) causes misspellings

This is using the latest version from https://github.com/validator/validator.github.io .
Calling .setHtml(true) when initializing the MessageEmitterAdapter seems to cause the repetition of the first letter in the sentence of some validation messages:

  • "Aattribute href not allowed on element span at this point."
  • "Eelement p not allowed as child of element ul in this context. (Suppressing further errors from this subtree.)"

Here's the main relevant part of my code, although I think the bug should be reproducible without it: https://github.com/cvrebert/lmvtfy/blob/master/src/main/scala/com/chrisrebert/lmvtfy/validation/Html5Validator.scala
It's in Scala but heavily based on your SimpleCommandLineValidator. I'm happy to help out if you have any trouble reproducing the problem. I have a couple of reliable Specs2 testcases that catch the bug.

X-Ref: validator/validator#2

"A" vs. "An" grammar error in validation message

$ java -jar vnu.jar http://jsbin.com/giquho/2/
"http://jsbin.com/giquho/2":20.6-20.6: error: Stray start tag “body”.
"http://jsbin.com/giquho/2":20.6-20.6: error: An “body” start tag seen but an element of the same type was already open.

Note the An “body”, which is grammatically incorrect.

X-Ref: validator/validator#1

build script "stacksize" option does not work with "test" task

Hello - newfag here, trying to build on raspberry pi 2:
"python ./build/build.py --stacksize=16384 build" does work.
"python ./build/build.py --stacksize=16384 run" does work
"python ./build/build.py --stacksize=16384 test" crashes with stackoverflow error
so i can't build it with the "all" option.

what can i do to resolve this error?
thanks

Website keeps refreshing on its own

Thank you for this website, it helps us to catch up the instruction of tools and the integration of CI.

We found currently the website keeps refreshing itself both on Chrome 106.0.5249.119 and Firefox 105.0.3 (64-bit), below is snapshot of network panels, which has multiple 304 status responses:

304-status-in-network-panels

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.