Last modified: 2010-05-15 15:37:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T4702, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 2702 - The parser will fail to match tags on input like ''[ text'']
The parser will fail to match tags on input like ''[ text'']
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: parser
Depends on:
  Show dependency treegraph
Reported: 2005-07-04 23:29 UTC by Ævar Arnfjörð Bjarmason
Modified: 2010-05-15 15:37 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Ævar Arnfjörð Bjarmason 2005-07-04 23:29:16 UTC
The parser will fail to match tags on input like ''[ text''],
it will produce output like (approximation) <i><a
href="">text</i></a> instead of <i><a href="">text</a></i>
like it should.

There's a parsertest for this bug titled "Mismatched <i> and <a> tags are invalid"
Comment 1 Gabriel Wicke 2006-03-18 10:36:59 UTC
With the current multi-pass parser it's difficult to fix nesting problems like
these. No nesting state is preserved between doAllQuotes() and
replaceExternalLinks(). Nevertheless, i'm working on another preg_replace hack
that fixes most of these cases.

''Something [ cool'']  -->  <i>Something</i><a
Comment 2 Gabriel Wicke 2006-03-18 12:27:03 UTC
I've got this test passing now:

!! test
Bug 2702: Mismatched <i>, <b> and <a> tags are invalid
!! input
''[ text'']
[ '''text]'''
''Something [ in italic'']
''Something [ mixed''''', even bold]'''
'''''Now [ both''''']
!! result
<p><a href="" class='external text' title=""
<a href="" class='external text' title=""
<i>Something </i><a href="" class='external text'
title="" rel="nofollow"><i>in italic</i></a>
<i>Something </i><a href="" class='external text'
title="" rel="nofollow"><i>mixed</i><b>, even bold</b></a>
<i><b>Now </b></i><a href="" class='external text'
title="" rel="nofollow"><i><b>both</b></i></a>
!! end
Comment 3 Gabriel Wicke 2006-03-24 17:38:08 UTC
Committed (code is active if tidy is disabled), closing therefore.

Note You need to log in before you can comment on or make changes to this bug.