joomla / coding-standards

Joomla Coding Standards Definition
https://developer.joomla.org/coding-standards/basic-guidelines.html
GNU General Public License v2.0
128 stars 129 forks source link

Can we change standard from <br /> to <br> ? #267

Open infograf768 opened 3 years ago

infograf768 commented 3 years ago

https://github.com/joomla/coding-standards/blob/master/manual/html.md#adding-line-breaks

afaik, it looks not necessary to use <br /> as this is rather for xhtml. <br> should be OK.

Ref: https://www.tutorialspoint.com/What-is-the-correct-way-of-using-br-br-or-br-in-HTML

So the question is:

  1. Shall we keep <br /> as a standard for 3.x
  2. Shall we change the standard to <br> generally speaking or specially for J4 as we have 9 occurences of <br /> 216 occurences of <br>

@mbabker @wilsonge @HLeithner

anibalsanchez commented 3 years ago

The latest HTML5 spec defines the br element as <br> https://www.w3.org/TR/html52/textlevel-semantics.html#the-br-element

So, the issue is more like the usage of <br />, that should be removed to avoid further confusion.

anibalsanchez commented 3 years ago

Of course, <br /> has to be removed from the coding standard as an option.

wilsonge commented 3 years ago

J3 will stand as xhtml compatible br (as we’ve had xhtml templates support there from early j3). From j4 should need be the html 5 br without the self closing tag

infograf768 commented 3 years ago

OK, used <br /> in staging as it looks like we have to keep that. Can someone modify the standard for J4?