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

Empty hash in URL #255

Closed
iBobik opened this issue Nov 3, 2015 · 8 comments
Closed

Empty hash in URL #255

iBobik opened this issue Nov 3, 2015 · 8 comments

Comments

@iBobik
Copy link
Contributor

iBobik commented Nov 3, 2015

Should be <a href="#"> really be reported as a non-existing hash?

It is often used for resetting hash in sites where hash is used to some changes in content, e.g. tabs and AJAX-loaded content.

Workaround is this parameter: --allow-hash-href

@akoeplinger
Copy link
Contributor

I agree: #118 :) Maybe it's time to ignore this by default?

@iBobik
Copy link
Contributor Author

iBobik commented Nov 3, 2015

Sorry, I did not found #118. Yes, default values should be friendly.

@gjtorikian
Copy link
Owner

How do you both feel about an implementation of #254 (that is, a without href)?

@iBobik
Copy link
Contributor Author

iBobik commented Nov 4, 2015

#254 is something different. <a href=„#” is needed for example to close
popup triggered by hash and many other frontend techniques.

Jan Pobořil

2015-11-03 19:30 GMT-06:00 Garen Torikian notifications@github.com:

How do you both feel about an implementation of #254
#254 (that is, a
without href)?


Reply to this email directly or view it on GitHub
#255 (comment)
.

@akoeplinger
Copy link
Contributor

Yeah, I agree, that's something different.

@iBobik
Copy link
Contributor Author

iBobik commented Nov 4, 2015

In other words, <a> is just general inline element like <span>, but ` is link to empty hash.

Jan Pobořil

2015-11-03 19:58 GMT-06:00 Alexander Köplinger notifications@github.com:

Yeah, I agree, that's something different.


Reply to this email directly or view it on GitHub
#255 (comment)
.

@gjtorikian
Copy link
Owner

Sorry, I did not found #118. Yes, default values should be friendly.

My problem with <a href="#"> is that it's too close to "dummy text" someone might write. For example, if we're going to use Bootstrap as an example, here's some code from their docs that uses # as a placeholder.

Although I understand that ignoring # may seem like a sane default 98% of the time, the fact is, if you are intentionally adding href="#" in your code, I think proofer should explicitly be told to ignore that link, whether through the data-proofer attribute or through using href-ignore. The alternative is much worse, of someone accidentally adding href="#", never realizing it, and having proofer pass.

Given that it's a common request, though, would not using href-ignore but acceptable, and instead a new option of allow-hash-hrefs be fine? Sort of like a shortcut to href-ignore, but just as a boolean.

@akoeplinger
Copy link
Contributor

Given that it's a common request, though, would not using href-ignore but acceptable, and instead a new option of allow-hash-hrefs be fine? Sort of like a shortcut to href-ignore, but just as a boolean.

That'd work for me.

johnzeringue added a commit to johnzeringue/html-proofer that referenced this issue Nov 9, 2015
Fixes gjtorikian#255 by adding a more intuitive option to allow the `href` `#`.
This option, `--allow-hash-href`, is equivalent to `--href-ignore '#'`.
Its Ruby option is `allow_hash_href`, which should be a boolean and
defaults to `false`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants