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

fixes #1721: CDATA support in text/coffeescript <script> tags #1788

Closed
wants to merge 1 commit into from

Conversation

michaelficarra
Copy link
Collaborator

No description provided.

@jashkenas
Copy link
Owner

Did we ever get it resolved why you would need to write CDATA? If so, and you think the regex is bulletproof, feel free to merge.

@DennisBB
Copy link

Jash, I gave you an example here, why it's required #1721 (comment)

@jashkenas
Copy link
Owner

I understand -- but XHTML as XML is deprecated, and no one actually serves XHTML as XML, because browsers don't handle it very well. In XHTML-style HTML, CDATA isn't necessary.

@michaelficarra
Copy link
Collaborator Author

Yeah, I'm not convinced it's ever necessary (and it's probably being used in production environments, even though we discourage that), but the principle of least surprise tells me we should allow it.

edit: By the way, I think that nickname is hilarious. "Jash". With the proper pronunciation of your surname, it sounds like "Josh".

@DennisBB
Copy link

there is no XHTML-style HTML, that's called a tag soup. It's just improperly written HTML. Real XHTML is only XHTML and parsed as XHTML when it has the proper content-type, which is application/xhtml+xml usually. So those are 2 modes XHTML and HTML that are supported by HTML 5. so XHTML as XML has never been deprecated. That's a misunderstanding.

@DennisBB
Copy link

I don't really understand what's the point of supporting IE 6 which everyone hates and is very outdated and not supporting one of 2 official HTML 5 modes, which is XHTML.

If you don't wanna support xhtml mode, your coffee script just won't be used on web sites. Supporting outdated IE 6 is a far worse decision imho.

@jashkenas
Copy link
Owner

@DennisBB: You're out of date, my friend. XHTML-style HTML (also known as the web, as it stands) is a big part of what HTML5 is all about.

http://www.w3.org/TR/html5/syntax.html

In fact, that syntax guide says that in HTML5, CDATA sections are only allowed in "foreign content (MathML or SVG)" ... so I wonder if they're disallowed in <script> tags altogether.

@michaelficarra
Copy link
Collaborator Author

your coffee script just won't be used on web sites

That's a good thing. As we said many times in #1721, it should not be used in production. Just compile it already. We don't want to get a bad reputation about performance or something because people are using this feature in an unintended way.

@DennisBB
Copy link

You don't understand it. Do you understand that XHTML-style HTML is tag soup? it's when you use content-type for HTML and HTML-compatible XHTML code. It means browser tries to parse XHTML code as HTML, that's a tag soup again! Which is a bad practice.

And in HTML5 of course CDATA is allowed (not required) in MathML, SVG, because those XHTML extensions are allowed in HTML. But in XHTML5 CDATA is required (because CDATA is made for XML) if you use something like <= in javascript for example.

And you can also read this article http://www.webkit.org/blog/68/understanding-html-xml-and-xhtml/ which explains everything I said in detail, from the makers of WebKit!

@DennisBB
Copy link

Michael, I really don't give a crap about what you are advising me. Whenever I want to use it, I will use it, and if it doesn't work, it just doesn't make sense to use it at all.

What's the point of making a feature badly and then arguin that it really should not be used. Can you better explain that?

@michaelficarra
Copy link
Collaborator Author

@DennisBB: First, please do not abuse the developers. We're just trying to help you. Second, we have this feature for ease of development. Instead of using the command-line compiler's -w flag, someone can just test in a browser and have it automatically compile every time the file is loaded. It has its uses, just not in a production environment. It's also a great proof-of-concept that shows that one day browsers may natively implement "text/coffeescript" support and we will have a nice, graceful degradation for old browsers. Though, I know @jashkenas isn't interested in that.

@DennisBB
Copy link

I can write you like a lot of quotes from that document why XHTML - style HTML is a very bad practice and it's in no where a part of HTML 5, it's just what they advice if ppl want they documents to be compatible with both standards. And it's not only me, but other experts as well as they write there.

So overall it seems best to go with HTML, and follow through consistently. But don’t just take my word for it. Leading web standards experts like Ian Hickson, Anne van Kesteren and Mark Pilgrim have all pointed out the pitfalls of serving XHTML as HTML.

@DennisBB
Copy link

Michael, I'm not insulting anyone. We are just arguing here.

And you still didn't explain what's the point of implementing a feature and implementing it badly. You guys are goin microsoft way, of kinda adding png support, but not png transparency.

@satyr
Copy link
Collaborator

satyr commented Oct 22, 2011

I don't really understand what's the point of supporting IE 6 which everyone hates and is very outdated and not supporting one of 2 official HTML 5 modes, which is XHTML

I don't really understand your point if that's your stance. This patch is useless if you're ignoring browsers that don't support XHTML mode (such as IE).

@DennisBB
Copy link

This patch is for browsers that support XHTML mode, which IE doesn't. That's why it's useful. I didn't understand you.

@satyr
Copy link
Collaborator

satyr commented Oct 22, 2011

This patch is for browsers that support XHTML mode, which IE doesn't. That's why it's useful

That's why I too didn't understand you, who said "I don't really understand what's the point of supporting IE 6."

@DennisBB
Copy link

How can the patch be useless if I'm ignoring browsers that don't support XHTML???

I'm indeed ignoring browsers that don't support real XHTML, like IE for example, that's why I need the patch, so it'll work in other browsers that support XHTML. The patch is for XHTML mode, don't you understand that?

@jashkenas
Copy link
Owner

So, as far as I can tell, the resolution is that this patch is useless if you're serving real XHTML, and if you're not serving real XHTML, don't use CDATA. Closing.

@jashkenas jashkenas closed this Apr 10, 2012
@GeoffreyBooth GeoffreyBooth deleted the issue1721 branch May 2, 2017 02:51
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

Successfully merging this pull request may close these issues.

4 participants