> A test case that validates all of the HTML output would be great. That
> should be content agnostic, of course, so that it can be maintained without
> requiring a lot of work for new versions.


IMHO, the W3C HTML Validator
https://validator.w3.org/
has always done a good job for validating HTML, both off- and online,
so I have no intention to reinvent the wheel with a new tool.
I just tested their new version, Nu Html Checker
https://validator.w3.org/nu/about.html
running a small script to validate the Fossil built-in web pages.

Maybe this discussion should be continued on the fossil-dev list instead.
Anyway, here goes the script (run it anywhere inside a Fossil repository):

-------------------
#!/bin/sh

# Validate Fossil built-in web pages with the W3C Nu HTML Checker
# https://validator.w3.org/nu/about.html
# The validator requires Java 8 to be installed.
# Install prequisites (tested on Ubuntu):
#   sudo apt-get install default-jre
#   wget 
https://github.com/validator/validator/releases/download/17.3.0/vnu.jar_17.3.0.zip
#   unzip vnu.jar_17.3.0.zip

mkdir -p fhtml
for w in `fossil help -w | xargs printf "%s\n"`
do
    printf "GET $w HTTP/1.0\n\n" | fossil test-http > fhtml/${w}.html
    grep -q 'Content-Type: text/html' fhtml/${w}.html
    if [ $? -ne 0 ];then
        # Delete non-HTML files
        rm fhtml/${w}.html
    else
        # Strip HTTP header from HTML files
        sed -i '1,/^\r\{0,1\}$/d' fhtml/${w}.html
    fi
done
java -jar dist/vnu.jar fhtml/* > validate.log 2>&1
-------------------

Short resume of validation result:

There are lots of closing </input> tags in the Fossil HTML, which is
invalid in HTML5. Just remove them.
For other errors, check validate.log

BR,
Johan
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to