Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data-proofer-ignore doesn't ignore HTML validity checks #543

Closed
ottomatias opened this issue Nov 11, 2019 · 5 comments
Closed

data-proofer-ignore doesn't ignore HTML validity checks #543

ottomatias opened this issue Nov 11, 2019 · 5 comments
Labels

Comments

@ottomatias
Copy link

ottomatias commented Nov 11, 2019

I'm adding social share buttons and the code is not valid HTML. I just learned for example that mailto: links MUST have a recipient in order to be valid, so we have to ignore these links for tests.
However, adding data-proofer-ignore to the elements themselves or their parent doesn't help.

The code I'm using is this:

<li><a data-proofer-ignore href="mailto:?subject=&;body=:%20https%3A%2F%2Fwww.domain.com%2F" target="_blank" title="Send email" onclick="window.open('mailto:?subject=' + encodeURIComponent(document.title) + '&body=' + encodeURIComponent(document.URL)); return false;"><i class="fas fa-envelope-square fa-2x" aria-hidden="true"></i><span class="sr-only">Send email</span></a></li>

And the proofer spits out:
* 187:226: ERROR: htmlParseEntityRef: expecting ';' (line 187)

This would imply an error just after the '&body='

The code I'm using is from here https://simplesharingbuttons.com.

@gjtorikian
Copy link
Owner

Eep, thanks for the example. I'll look into this now.

@gjtorikian
Copy link
Owner

I can't reproduce this. Here's the error, without the data-proofer-ignore (bfe0b7c). And here's the fix showing data-proofer-ignore working (1528778).

This actually doesn't seem like a link check error, and it's likely that you've passed "check HTML" in (check_html: true) as an option, resulting in the error. While that unescaped & is in fact an issue, I would expect that data-proofer-ignore should ignore that markup as you wished it to.

@ottomatias
Copy link
Author

I noticed I was not running the newest version, but I can reproduce this with 3.13.0. What I didn't say in the beginning is that I'm running htmlproofer on the command line. That shouldn't affect, but..

I made a new html file that contains only

<li><a data-proofer-ignore href="mailto:?subject=&;body=:%20https%3A%2F%2Fwww.domain.com%2F" target="_blank" title="Send email" onclick="window.open('mailto:?subject=' + encodeURIComponent(document.title) + '&body=' + encodeURIComponent(document.URL)); return false;"><i class="fas fa-envelope-square fa-2x" aria-hidden="true"></i><span class="sr-only">Send email</span></a></li>

And running htmlproofer --check-html gives an error. To me data-proofer-ignore would mean that all checks should be ignored. Can you reproduce this on command line? I

@gjtorikian
Copy link
Owner

To me data-proofer-ignore would mean that all checks should be ignored.

Yes, I agree. I intentionally thought that the issue was that the link was not being ignored, but now I see that it's the HTML check.

@gjtorikian gjtorikian changed the title data-proofer-ignore doesn't ignore all checks data-proofer-ignore doesn't ignore HTML validity checks Nov 17, 2019
@gjtorikian
Copy link
Owner

Hi—the next version of HTMLProofer won't have HTML checking at all anymore. I am going to close this issue out, as I'm just one person and can't maintain both the 3.x and 4.x features. ✌️

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

No branches or pull requests

2 participants