Skip to content

Message is produced in contradiction of documentation #320

Closed
@benkasminbullock

Description

@benkasminbullock

The following command:

./tidy --alt-text "moo" --show-body-only yes --quiet yes

run on this input

 <img src='http://example.com/example.png'>

produces output

line 1 column 1 - Warning: <img> lacks "alt" attribute
<img src='http://example.com/example.png' alt="moo">

This contradicts the documentation:

https://github.com/htacg/tidy-html5/blob/0ef4493ae8bdc4b8fec125fecf4e1dcc95c30fb1/src/localize.c#L405

which says

"Use with care, as this feature suppresses further accessibility warnings. "

The code clearly doesn't check for the option before issuing the warning:

The warning is issued here:

TY_(ReportMissingAttr)( doc, node, "alt" );

which is before the check for the accessibility text:

if ( cfgStr(doc, TidyAltText) )

The fix is obvious, but I have no idea whether the documentation is incorrect, or the code is incorrect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions