Skip to content

Add context to error messages #706

@petdance

Description

@petdance

Have we considered adding the context of the error messages?

Right now we get error messages like this:

line 187 column 30 - Warning: <input> isn't allowed in <table> elements
line 205 column 37 - Warning: missing </font> before <p>
line 211 column 45 - Warning: missing </b> before <p>
line 232 column 30 - Warning: <input> isn't allowed in <table> elements
line 250 column 55 - Warning: <p> anchor "at-price-type-label" already defined

It would be extremely helpful when debugging to (optionally of course) see the
line of HTML that tidy was complaining about.

line 187 column 30 - Warning: <input> isn't allowed in <table> elements
                        </tr><input type="hidden" name="showbooks" value="1">                    <tr>

line 205 column 37 - Warning: missing </font> before <p>
            <td>                    <font color="red"><p id="at-price-type-label">NYC Quote</p></font><br />

line 211 column 45 - Warning: missing </b> before <p>
                    </p>                    <b><p>Prices do not include cataloging or processing</p></b>            </td>

line 232 column 30 - Warning: <input> isn't allowed in <table> elements
                        </tr><input type="hidden" name="showbooks" value="1">                    <tr>

line 250 column 55 - Warning: <p> anchor "at-price-type-label" already defined
            <td>                    <font color="red"><p id="at-price-type-label">NYC Quote</p></font><br />

I understand there are issues about this, such as "How do we handle lines longer than, say, 150 characters?", but I didn't want to go down that road if this has already been considered and rejected.

I was about to add support for this to the Perl HTML::Tidy5 module, but realized it would make more sense at the libtidy level if that's something that you'd like to support. And if it doesn't make sense at the library level, then I'll go ahead and add it to the Perl wrapper.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions