Skip to content

tidy -utf interpreted as tidy -u -t -f instead of as -utf8, without error #921

Open
@bryceharrington

Description

@bryceharrington

Forwarding a usability issue reported by a Ubuntu user, from https://bugs.launchpad.net/ubuntu/+source/tidy-html5/+bug/1914865

Running tidy -utf ... is treated as tidy -u -t -f ..., rather than as tidy -utf8 as the user intended.

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

The -u option is synonymous with -upper, producing upper-cased tags in the output, which causes unexpected results particularly if one has set "uppercase-tags: no" in ~/.tidyrc, such as in the original bug report.

It might help if tidy returned a non-zero exit code when invoked with unrecognized options. (Even better might be to exit immediately with a usage message.) Then the warnings would be more visible and the user might be able to figure out their error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions