Skip to content
This repository was archived by the owner on Apr 14, 2019. It is now read-only.

Requireing quotes around attribute values #14

Open
szabgab opened this issue Oct 24, 2014 · 4 comments
Open

Requireing quotes around attribute values #14

szabgab opened this issue Oct 24, 2014 · 4 comments

Comments

@szabgab
Copy link

szabgab commented Oct 24, 2014

Is there a way to ask HTML::Tidy to report cases where the HTML code does not have quotes around the attributes? Like in this case:

<td class=label>

@holcapek
Copy link

holcapek commented Jan 9, 2015

Looks like the example is missing in the above comment (perhaps GH misinterpreted the HTML fragment?), but I guess @szabgab had something like that on mind:

<p class=foo>text</p>

@holcapek
Copy link

holcapek commented Jan 9, 2015

To address the question, based on the statement below (found in tidyp documentation), I would say no, there is no way to report such cases:

Things awaiting further attention
...
Noticing that the document isn't really XHTML if it isn't
wellformed, i.e. it lacks end tags and quotes on attribute
values

https://github.com/petdance/tidyp/blob/9d13f64b4a2955d95d5f870b14978bbbdc84a30c/htmldoc/pending.html#L86

@szabgab
Copy link
Author

szabgab commented Jan 10, 2015

Oh, I've forgotten to tripple-quote the code-snippet and so SO did not show it. Now fixed and you are right.

@geoffmcl
Copy link

@szabgab, @holcapek sorry to be years late to this issue ;=))

As @petdance sort of points out in the blog, there is no way to ask HTML::Tidy, based on tidyp, which was based on cvs C HTML Tidy library, to warn about this, but the C library does silently fix the issue...

Now there is discussion to replacing tidyp, with a now well maintained modern libtidy, but even modern C HTML Tidy library still does not warn about this!

But there is active discussion on this topic... see Issue 412, and Issue 561, for a broader discussion, and I am sure there have been other HTML Tidy issues on this...

The general consensus seems to be that there should at least be an option to ask libTidy to report such situations, even though it does silently provide the fix in the cleaned output...

So if @petdance embraces this change, which he seems to, then the correct place to file such an issue would be here... Then if added to C HTML Tidy library, perl HTML::Tidy would automatically benefit... thanks...

I have now completed both a Windows and Linux build of such a perl HTML::Tidy update in my fork, in the test1 branch, for Windows, and the test2 branch, for Linux... still a WIP... but any help or testing would be greatly appreciated... thanks...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants