Page MenuHomePhabricator

Bold and italic render as apostrophes when wrapping an HTML comment
Open, LowPublic

Description

Author: srbauer

Description:
When a html comment is tagged with apostrophes as bold or italic then the parser
should deliver no visible character, but an apostoph is delivered.

Example:
''' ''' is parsed correct

'''''' is parsed as '
'''<!-- -->''' is parsed as '
'''''<!-- -->''''' is parsed as '''''

This construct is hardly ever used in plain wiki source code but it is easily
created by the use of templates (see
http://de.wikipedia.org/w/index.php?title=Prison_Break&oldid=15297064 for
example - the apostroph in the first line of the infobox should not be there).


Version: 1.6.x
Severity: minor
URL: http://de.wikipedia.org/wiki/Benutzer:Srbauer/Bug-Test

Details

Reference
bz5437

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:10 PM
bzimport set Reference to bz5437.
bzimport added a subscriber: Unknown Object (MLST).

This is hard to fix cause we strip comments before parsing quotes.
So doQuotes() see:

''''''
'''<!-- -->'''
'''''<!-- -->'''''

as:

'''''' 6 quotes
''''''
6 quotes
'''''''''' // 10 quotes

We only consider the first five quotes and assumes everything before is
meant to be text. So 5 consecutive quotes are rendered as <b></b>
and the parser render above text as:

'<b></b>
'<b></b>
'''''<b></b>

Which is "correct".

A possibility would be to actually render comments as HTML comments,
but that can possibly be a lot of work for little reward. I would say
WONTFIX this bug and let user add a space before or after the comment
block so they can fix the bug by themselves :)

fabartus wrote:

This seems like it's related... See the two source pages, especially the lowest
section, and look at the leading scare quotes. The diff, has whitespace
compression distorting the work around I employed. Basically
<pre>
...something ''''C''''
to
...something''' 'C''''
</pre>
made in 4-6 places. An true ascii diff utility will show those.

Diff:[http://en.wikipedia.org/w/index.php?title=Template%3ACommons-gallery&diff=112418474&oldid=112417275
this]

NOTE: this is contrary to the published way the four single quotes are supposed (and USED TO) work.

Best regards // ~~~~

P.S. Ad hoc feature suggestion... this page needs a preview screen. Would be
really nice to have one in Wiki-email facility too.

P.P.S. -- Just one thought... spaces before and after comments not infrequently
break things... that good old wonderful grey box kind of break. In particular in
doing template coding. Why not parse six and render <nowiki><b><i>'</nowiki>...
you can't be parsing that many pages with five or six single quotes!

Still has the issue.

Text:
'''<!-- -->'''

Parse result:
<p>'
</p>

I believe the request is to have it render as: <b></b>

Might be a wont fix though.

oh, missed the ! part. yes, still a bug.

With MediaWiki core cce762f9898fdb9286ecfe5da1834887e53a2bd1

Input PreviouslyNow
''' '''correct<b> </b>
''''''is parsed as 'still '
'''<!-- -->'''is parsed as '<b>&lt;\!-- --&gt;</b>
'''''<!-- -->'''''is parsed as '''''<i><b>&lt;\!-- --&gt;</b></i>