Skip to content
This repository was archived by the owner on Mar 26, 2018. It is now read-only.

Close <head> tags #177

Closed
wants to merge 8 commits into from
Closed

Close <head> tags #177

wants to merge 8 commits into from

Conversation

samaxes
Copy link
Contributor

@samaxes samaxes commented Apr 20, 2013

No description provided.

@kevva
Copy link
Member

kevva commented Apr 20, 2013

What do you mean by "max compatibility"? They will be parsed correctly in all browsers without being self closed.

@kevva kevva closed this Apr 20, 2013
@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

Allows you to set the 'application/xhtml+xml' media type in the HTTP response without breaking the site.
XHTML uses the draconian error handling and requires the tags to be closed.

Please consider reopening this pull request as it is very useful to use XHTML media type for older mobile browsers.

@kevva
Copy link
Member

kevva commented Apr 20, 2013

I'd argue that's an edge case. It's easy enough to change them yourself.

@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

And what's the down-side of closing the tags in the template?

@kevva
Copy link
Member

kevva commented Apr 20, 2013

We don't need them, that's why this doesn't get pulled in. You think we should add type="text/javascript" on all script tags too? There will likely be XML errors regardless if we have closing tags or not.

@btford
Copy link
Contributor

btford commented Apr 20, 2013

@samaxes Just curious: what older browsers?

While it'd be nice to support something like this (for those edge cases), I think we'd need to do a lot of work to make these changes. I don't personally want to be accountable for maintaining XHTML support, especially since the trend seems to be away from it. Yeoman is opinionated, and I think it's fine for us to have "HTML5 doctype" as an opinion.

@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

No, I don't as they are optional in last HTML spec.
But I would argue that using " in attributes (e.g. width="60" instead of width width=60) and closing tags is a good practice.
Moreover, the template has some tags which are closed (e.g. <meta charset="utf-8"/>) and others (the ones I closed in the pull request) which are not.

@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

@btford I'm talking about the serialization/media type here, not the spec. HTML5 spec allows you to use both HTML5 or XHTML5 serialization: http://html5doctor.com/html-5-xml-xhtml-5/.

@kevva
Copy link
Member

kevva commented Apr 20, 2013

application/xhtml+xml wont be served as HTML but XML.

@passy
Copy link
Member

passy commented Apr 20, 2013

In addition, Yeoman in general builds on top of HTML5 Boilerplate as far as that is applicable within the scope of the generator.

@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

@kevva Exactly, you can serve HTML5 documents (using HTML5 doctype) but using XHTML5 serialization with the correct media type (which is application/xhtml+xml).

@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

@passy I don't get the relationship with the issue at hand.

@passy
Copy link
Member

passy commented Apr 20, 2013

We try to minimize differences if possible, this creates new ones.

@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

@passy which differences? Currently the template closes some tags in the head element and not the others. Do you have a reason for that?

@passy
Copy link
Member

passy commented Apr 20, 2013

@samaxes That's a valid point. Feel free to submit a PR that removes the trailing slash for the inconsistent ones. :)

@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

@passy That can be done. But I believe that you, like me, would prefer the opposite ;)

@kevva
Copy link
Member

kevva commented Apr 20, 2013

I see your point, but it doesn't make sense to partly support XHTML. There would still be errors as I said previously. We would have to maintain a polyglot version of this inside a separate branch to fully support it or maybe have an option like --xhtml and make use of conditional tags in the markup.

That's a lot of work to cater for a very small group of people.

@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

Forget about XHTML, because as you say, it's a lot more complicate that this and you would have to do a lot more stuff to be "XHTML compliant" (like using data-* attributes: data-ng-app instead of simply ng-app, etc.). Just think of this as a best practice. And please consider merging it into the template.

@kevva
Copy link
Member

kevva commented Apr 20, 2013

@samaxes, exactly. That's my point. So why should we pull this in? What says it's a best practice?

passy added a commit that referenced this pull request Apr 20, 2013
@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

@kevva We use the Polyglot Markup spec for best practice guidelines:

Polyglot markup that meets a well defined set of constraints is interpreted as compatible, regardless of whether they are processed as HTML or as XHTML, per the HTML5 specification.

This document summarizes design guidelines for authors who wish their XHTML or HTML documents to validate on either HTML or XML parsers, assuming the parsers to be HTML5-compliant. This specification is intended to be used by web authors.

@kevva
Copy link
Member

kevva commented Apr 20, 2013

Yes, according to that spec it's the best practices. But we're using HTML5 which says you can use both. And as @passy said above, we're trying to keep the differences from h5bp as few as possible hence no self closing tags.

@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

Polyglot Markup spec is the HTML5 best practices guidelines. The HTML5 spec does not define best practices for web authors, it is more oriented for user agents.

passy added a commit that referenced this pull request Apr 20, 2013
@passy
Copy link
Member

passy commented Apr 20, 2013

@samaxes This is probably the wrong place, though. You should lobby HTML5 Boilerplate instead. If they change to XHTML5, we will certainly consider changing the base templates.

@btford
Copy link
Contributor

btford commented Apr 20, 2013

I agree that we should be consistent in how we handle self-closing tags, but I don't feel strongly one way or another. I think @passy is right about sticking to what H5BP does for now.

But I don't want to dismiss @samaxes use case. I'd love to hear from @necolas or @paulirish and see if they think H5BP can/should adhere to the Polygot Markup Spec.

At very least, I plan to support multiple markup languages in the near future (see #74). With this in place, it'd be easy to add an option for this.

@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

I do agree that if you use H5BP as the base for your HTML templates you should stick with them.
I will try to bring this discussion to them.
Thanks!

@necolas
Copy link

necolas commented Apr 20, 2013

We get 0 issues about self-closing tags. When do you ever really need them?

@kevva
Copy link
Member

kevva commented Apr 20, 2013

@samaxes, well this is intended for authors as well and it's suggesting use of void elements without self closing tags. At least in their examples.

@necolas, in XML documents. If you for some reason need to use XML over HTML.

@necolas
Copy link

necolas commented Apr 20, 2013

Who is writing XML-based web apps?

@kevva
Copy link
Member

kevva commented Apr 20, 2013

You tell me. An edge case to say the least.

@necolas
Copy link

necolas commented Apr 20, 2013

That's my point. You never need self-closing tags when you're writing web applications.

@kevva
Copy link
Member

kevva commented Apr 20, 2013

Exactly, that's why I disagree with this change. I wouldn't consider the Polyglot spec best practice for authors either. Maybe if you want your document to be both valid HTML and XML which, to my knowledge, is very rare.

@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

@necolas So you believe that XHTML5 serialization should be removed from the HTML5 spec and the use cases for it to be included do not make any sense?

@necolas
Copy link

necolas commented Apr 20, 2013

So you believe that XHTML5 serialization should be removed from the HTML5 spec and the use cases for it to be included do not make any sense?

No.

@samaxes
Copy link
Contributor Author

samaxes commented Apr 20, 2013

My point is that the amount of effort needed to implement the best practice guidelines from the Polyglot Markup spec is negligible. However, allowing the web app author to freely choose the serialization he likes the most is a huge benefit.

@sindresorhus
Copy link
Member

Please continue this discussion elsewhere. Thanks.

@samaxes samaxes deleted the index-head-template branch May 1, 2013 02:27
manjunathkg pushed a commit to manjunathkg/generator-angular that referenced this pull request Jun 6, 2013
searchPath parameter for wiring.appendFiles
tmaximini pushed a commit to tmaximini/generator-angular-fullstack that referenced this pull request Jun 18, 2014
Lower case the user email field in when passport queries to find a user
during login. Also lowercase the email on user creations. Fix yeoman#177
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants