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

title="" shouldn't be removed #331

Closed
coliff opened this issue Sep 17, 2020 · 2 comments
Closed

title="" shouldn't be removed #331

coliff opened this issue Sep 17, 2020 · 2 comments

Comments

@coliff
Copy link

coliff commented Sep 17, 2020

I noticed that (using Hugo 75) the input:
<input title="" required>
is minified to:
<input required>
This has the unexpected side effect of removing the empty title which is actually useful as it prevents the browsers default 'Please fill in this field.' tooltip from displaying when hovering over an input with the required attribute. It would be good if title="" wasn't removed.

@tdewolff
Copy link
Owner

Thanks for the issue! According to https://html.spec.whatwg.org/multipage/dom.html#the-title-attribute it is stated:

If this attribute is omitted from an element, then it implies that the title attribute of the nearest ancestor HTML element with a title attribute set is also relevant to this element. Setting the attribute overrides this, explicitly stating that the advisory information of any ancestors is not relevant to this element. Setting the attribute to the empty string indicates that the element has no advisory information.

In other words, you're right. Setting an empty title is relevant and this is a bug, I'll work on a fix soon!

@tdewolff
Copy link
Owner

Should be fixed, I'll push out a new version soon!

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

2 participants