Page MenuHomePhabricator

Invalid hint about <br> tag in Translate extension
Closed, ResolvedPublic

Description

Translate extension interface incorrectly tries to push user to write <br /> instead of <br>, preventing them from editing (at least in TUX). Even if developers of Translate extension prefer the stricter version in line with XHTML, MediaWiki doesn’t differentiate between both, so it shouldn’t be a breaking bug for the extension. W3C specification doesn’t require trailing slash for void elements: https://www.w3.org/TR/html5/syntax.html#start-tags

Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single "/" (U+002F) character. This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing.

Text: Please replace the following tag with correct ones: <br> → <br />
Screenshot:


Point of reference: T134423.

Event Timeline

stjn created this task.Mar 23 2017, 1:15 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 23 2017, 1:15 PM
stjn renamed this task from Invalid hint about <br> tag to Invalid hint about <br> tag in Translate extension.Mar 23 2017, 1:16 PM

Yes it seems the br rule is no longer relevant, but the issue appears because you are adding <br> where one does not exist in the source text.

Nemo_bis closed this task as Invalid.Mar 24 2017, 7:40 AM
Nemo_bis added a subscriber: Nemo_bis.

There seem to be two real issues here:

  • you are adding markup which the source text doesn't have (why are you? as a Meta-Wiki translation admin I suggest you to report any problems you have);
  • the message about unexpected markup is confusing.

However I don't think that suggesting to prefer <br /> over <br> is incorrect as of now; on many wikis users hate <br> so much that there are even bots to replace them (as much as I dislike such bots).

Nikerabbit reopened this task as Open.Mar 24 2017, 7:43 AM
Nemo_bis removed a subscriber: Nemo_bis.Mar 24 2017, 7:47 AM
Nemo_bis updated the task description. (Show Details)Mar 24 2017, 7:52 AM
stjn added a comment.Mar 24 2017, 10:26 AM

Yes it seems the br rule is no longer relevant, but the issue appears because you are adding <br> where one does not exist in the source text.

This is not the case, since there’s no hint about adding <br />, only <br>. <br /> isn’t in the source text either, but no hints etc. appear for it: https://i.imgur.com/LWiZFgk.png (sorry about not using file uploads).

I agree that there’s no consensus over which variant is correct (although HTML spec is clear on that part), but Translate extension then shouldn’t force users to any variant either. As I said above, right now you can’t even use normal tag (<br>) in the message, it instantly appears as incorrect in the final text: https://i.imgur.com/rgTW5iC.png

I agree, the hint "Please replace the following tag with correct ones" (bold is mine) is irrelevant, since it is just untrue. <br> is not just correct, but is a preferred version in all major HTML style guides that I know of: Google, jQuery, GitHub. Last XHTML specification recommended for use was updated back in 2010, it is pretty much an outdated standard.

Change 345318 had a related patch set uploaded (by Nikerabbit):
[mediawiki/extensions/Translate@master] Remove Xhtml check for translatable pages and extensions

https://gerrit.wikimedia.org/r/345318

Change 345319 had a related patch set uploaded (by Nikerabbit):
[translatewiki@master] Remove xhtml check from mediawiki core and extension

https://gerrit.wikimedia.org/r/345319

Nikerabbit triaged this task as Low priority.

Change 345319 merged by jenkins-bot:
[translatewiki@master] Remove xhtml check from mediawiki core and extension

https://gerrit.wikimedia.org/r/345319

Change 345318 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Remove Xhtml check for translatable pages and extensions

https://gerrit.wikimedia.org/r/345318

Nikerabbit closed this task as Resolved.Apr 16 2017, 3:40 PM
Nikerabbit removed a project: Patch-For-Review.