Comment 3 for bug 1914865

Revision history for this message
Bryce Harrington (bryce) wrote :

This is really confusing behavior on the part of html5-tidy's handling of command line arguments, but probably has to be this way for historical reasons. From the output you can see what's going on:

$ echo "" | tidy > /tmp/test.html
$ tidy -utf /tmp/test.html > /dev/null
HTML Tidy: unknown option: t
HTML Tidy: unknown option: f
...
$ echo $?
0

It's interpreting "-utf" as "-u -t -f"; -t doesn't exist so gets a warning, but -u is a synonym for -upper:

$ tidy -h
 ...
 -upper, -u force tags to upper case

The -f option does exist so it's weird that it gives an 'unknown option' warning for that too, but it does require a writeable filename so the usage is wrong here anyway.

So, it does indeed give warnings on the invalid '-utf' option but they're hard to spot in the output, and notably it does not exit with a non-zero error code, so the error wouldn't be caught within a toolchain or script. This is a legit problem but kind of a confusing corner case so I'm setting priority to Low. This would be best reported and addressed upstream, since there might be users depending on the current behavior and changing it might have unintended consequences.