Page MenuHomePhabricator

Convert "--!>" to placeholder text that wont be recognized by browsers as a comment closing tag.
Closed, ResolvedPublic

Description

In this edit something strange happened: https://se.wikimedia.org/w/index.php?title=N%C3%A4sta_dagordning&diff=27874&oldid=27867

In the top (where nothing were changed, a nowiki was added unexpectedly.


Version: unspecified
Severity: minor
URL: http://parsoid-lb.eqiad.wikimedia.org/sewikimedia/N%C3%A4sta_dagordning?oldid=27867

Details

Reference
bz58184

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:31 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz58184.

I reset the page but the HTML supplied to VE by Parsoid is broken:

http://parsoid-lb.eqiad.wikimedia.org/sewikimedia/N%C3%A4sta_dagordning?oldid=27867

<dl data-parsoid="…"><dt data-parsoid="…">Tid</dt><dd data-parsoid="…"> 9 december 2013 klockan 18.30 på kontoret/via Google Hangout.</dd></dl>
<!--
; Närvarande
; Frånvarande
-->
;Läsning:
*
= INLEDNING =
== Mötets öppnande ==
== Val av justeringsman ==
== Val av sekreterare==

Unsurprisingly, this round-trips poorly. :-(

Three different ways of handling the broken comment:

  • PHP + Tidy combination seem to ignore --!> and extend the comment till it finds a --> .. but, this combination seems to be stripping out the comment till the closing "-->"
  • Parsoid seems to be parsing this the same way, except that the comment is not stripped out and is left behind.
  • Browsers seem to be quite liberal and accept the broken --!> as a closing comment tag which means everything after the --!> which Parsoid treated as part of a comment is rendered as plain text.

I dont think this is a high priority fix required in Parsoid. In Parsoid rendering, broken comments will become visible and are likely to get fixed up in wikitext. I think that is how it should be rather than add a bunch of hacks in Parsoid to handle this scenario.

I am inclined to mark this WONTFIX, but leaving this open in the low/minor category in case you see it differently.

The fix for this would be as indicated in the title. This would still dirty diff, but the behavior would be consistent with what the PHP+Tidy combination does and works around browser's leniency around broken comments.

Change 147051 had a related patch set uploaded by Arlolra:
Accept --!> as a comment closing tag

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

Change 147051 merged by jenkins-bot:
Suppress --!> as a comment closing tag in browsers

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