I recently replied to an on-wiki discussion about the various forms of the
<br> tag in articles. Here's a rough translation of my thoughts back then,
also in hope that I can be fact-checked :D

1) Messages are wikitext, which is "related to", but not "a superset of"
HTML. The wikitext parser does not distinguish between the various forms of
the tag, so it shouldn't matter which is used.
2) Certain tools with stricter parsing might prefer the version with the
slash. I specifically had a gadget in mind that does this; but I'm not sure
if it's relevant in the context of system messages, probably not. My
impression here (but I don't have proof) is that the version with the slash
is more likely to be well understood by more tools.
3) And most important: the <br> tag should often be avoided altogether. As
explained for example in MDN (
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/br),
it is useful for poems, addresses, and other types of text «where the
division of lines is significant». So, unless we have actual poetry in
system messages (which actually sounds fun -- why have boring error
messages when you can have limericks and haikus? Uhm okay, back on topic
before I file a task), there's usually a more appropriate way to encode the
layout, for example <p> paragraphs or bullet lists. Granted, I don't know
how it's currently used in messages, and maybe those usages make somewhat
sense; I'm more familiar with usages in articles on my home wiki, and those
are semantically wrong almost all of the time.

So, my favourite answer to the question is: write it without "/", and also
without "<br" and ">" ;)

Il giorno sab 28 feb 2026 alle ore 23:19 SomeRandomDeveloper via Wikitech-l
<[email protected]> ha scritto:

> Hi,
>
> most messages containing *<br>* tags are not directly used as raw HTML,
> but instead parsed, so from a compatibility perspective it shouldn't really
> matter which form you're using in message translations, as the parser will
> turn all of them into the same form anyways.
> I checked a random Wikipedia page, and it looks like the legacy parser
> outputs the elements as *<br />*, while Parsoid uses *<br>*.
> The message parser used in JavaScript (jqueryMsg) outputs them as *<br>* as
> well (at least when using .parse(), which uses jQuery to serialize the
> elements to HTML).
>
> On Sat, Feb 28, 2026 at 2:49 PM Amir E. Aharoni via Wikitech-l <
> [email protected]> wrote:
>
>> Hi,
>>
>> Some translatable messages in MediaWiki and extensions have <br> tags.
>>
>> Sometimes they are written as <br>, sometimes as <br />, and sometimes as
>> <br/>. I would love to make it consistent across all the messages, but I'm
>> not totally sure which form to choose.
>>
>> I recall that many years ago, I read an article that recommends using <br
>> />, because it was the most compatible form with the various browsers and
>> HTML standards.
>>
>> Things probably changed since then. From what I'm reading online now, the
>> <br> form is probably the best.
>>
>> However, I might be wrong. Are there still any good reasons to use <br />
>> or <br/> in 2026, or is it safe to switch to <br> everywhere?
>>
>> --
>> Amir Elisha Aharoni · אָמִיר אֱלִישָׁע אַהֲרוֹנִי
>> http://aharoni.wordpress.com
>> ‪“We're living in pieces,
>> I want to live in peace.” – T. Moore‬
>> _______________________________________________
>> Wikitech-l mailing list -- [email protected]
>> To unsubscribe send an email to [email protected]
>>
>> https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
>
>
>
> --
> Best regards
> SomeRandomDeveloper
> _______________________________________________
> Wikitech-l mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/



-- 
https://meta.wikimedia.org/wiki/User:Daimona_Eaytoy
"Daimona" is not my real name -- he/him
_______________________________________________
Wikitech-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/

Reply via email to