coding-standards icon indicating copy to clipboard operation
coding-standards copied to clipboard

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

Open infograf768 opened this issue 5 years ago • 4 comments

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

infograf768 avatar Aug 28 '20 10:08 infograf768

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 avatar Aug 28 '20 10:08 anibalsanchez

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

anibalsanchez avatar Aug 28 '20 10:08 anibalsanchez

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

wilsonge avatar Aug 28 '20 11:08 wilsonge

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

infograf768 avatar Aug 28 '20 19:08 infograf768