Closed (won't fix)
Project:
Drupal core
Version:
7.x-dev
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
5 Jan 2009 at 00:18 UTC
Updated:
1 Jul 2012 at 09:15 UTC
Jump to comment: Most recent file
I do not know why on Earth people think that the <br> tag when written in proper XML needs a space as in <br /> since it is not only optional, but if you have to write 1,024 of them all of a sudden you lose 1Kb of data for nothing.
In any event, that's my rant! 8-)
That being said, since <br/> is perfectly legal and I use it all the time, you need to fix your code in the node_teaser() function and check for that case too.
And as you are at it, you may want to back-port to version 6.x
Thank you.
Alexis Wilke
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 354319.patch | 2.92 KB | dawehner |
| #3 | 354319.patch | 810 bytes | lambic |
| node-7.x-br-n-space.patch | 490 bytes | AlexisWilke |
Comments
Comment #2
AlexisWilke commentedOkay... Could someone tell me what test is failing?
When I click on the "Detailed results" it shows me the results, but no information about the test.
Plus, if the test is wrong (which it has to be, really!) how will this be ever checked in???
Comment #3
lambic commentedlooks like this was moved to the field module, rerolled against HEAD and as a root level patch
Comment #4
AlexisWilke commentedThank you lambic! I thought no one had seen this bug... 8-)
Comment #5
dawehnerSo if we introduce it, shouldn't there be a test for it too?
Comment #6
roychri commentedI tried so many scenarios to try to break it and I did not find anything wrong.
RTBC
Comment #7
dries commentedFrom http://en.wikipedia.org/wiki/User:Davidgothberg/The_br_tag:
Writing the XHTML code <br/> without a blank is against the recommendations of the World Wide Web Consortium, instead it should be written as <br /> since then HTML parsers can understand it too. HTML parsers will simply regard <br /> as a "br" with an unknown parameter "/", while they will regard "br/" as an unknown tag name. So we should definitely not teach people to write <br/>, but possibly <br />.So not sure this patch is a good idea...
Comment #8
roychri commentedHmmm. Interesting...
From the consortium:
http://www.w3.org/TR/xhtml1/guidelines.html#C_2
Comment #9
AlexisWilke commentedDries,
I have never seen any HTML browser fail on a <br> or <br/>. Maybe some other HTML tools, but that I don't care, we're talking about Drupal here. Also the link you offer does not work.
roychri,
Interesting indeed. I had not seen that one. Now, it is okay, but for those who look at the XML definition (like me) they are likely to miss that one line. Also, that Appendix C is marked as follow: "This appendix is informative." That means for a tool like Drupal, you may want to be a bit more advanced...
All,
So... The Empty tag is defined here:
http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EmptyElemTag
As you can see the space is optional (as implied by the question mark.)
Now what this patch allows is silly users like me to write <br/> without a space, it does not promote the fact that you should do that. The HTML actually looks very broken if you skip those tags. And for people who already have content and want to start with Drupal doing some copy & paste of their existing pages, it would be a pain to have to fix all the BR tags just because of a space.
Finally, if you are worried about the browsers getting <br/> tags and failing, we could always have a filter to fix it (and all the empty tags if that matter.) That way, we allow users flexibility, but browsers conformity. (best of both worlds!)
Comment #10
dries commentedI think more people write
<br />than<br/>. The proposed fix works for some but breaks the behavior of users that do the right thing. We'll need to go back to the drawing board on this -- and it will have to be a Drupal 8 thing, I'm afraid.Comment #11
drupal_was_my_past commentedThis issue is stale and had two strong arguments against it. Marking won't fix.