Last modified: 2014-09-24 01:24:18 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 T11996, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 9996 - Multiline tags in lists should be output more intelligently
Multiline tags in lists should be output more intelligently
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: newparser
: 28691 33918 (view as bug list)
Depends on:
Blocks: tidy
  Show dependency treegraph
 
Reported: 2007-05-21 20:56 UTC by Platonides
Modified: 2014-09-24 01:24 UTC (History)
5 users (show)

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


Attachments
Parsertest (514 bytes, patch)
2007-05-21 20:56 UTC, Platonides
Details

Description Platonides 2007-05-21 20:56:32 UTC
Created attachment 3662 [details]
Parsertest

Related with bug 5497, 

*Some enumeration<div style="clear: both; color: red">
This text should be red
</div>

produces 
<ul><li>Some enumeration<div style="clear: both; color: red">
</li></ul>
<p>This text should be red
</p>
</div>

"fixed" by tidy the wrong way:
<ul><li>Some enumeration<div style="clear: both; color: red"></div>
</li></ul>
<p>This text should be red
</p>

which affect several templates.
Comment 1 Michael Daly 2007-05-21 21:52:22 UTC
Your first example is not legal HTML.  The fix by Tidy is correct.

You cannot overlap tag starts and ends:

<tagA>
<tagB>
</tagB>
</tagA>

is legal.

<tagA>
<tagB>
</tagA>
</tagB>

is not legal
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-05-22 00:03:02 UTC
The illegal behavior was not being requested.  See the parser test.  It's questionable what behavior is acceptable for this period, given that attributes may include borders or floats or who knows what.  The best solution is to not provide illegal markup in the first place.

Note that parser tests are run with Tidy off, and so parser tests for this are probably pointless.  Furthermore, this is an upstream issue, so it should probably stay closed anyway.
Comment 3 Platonides 2007-05-22 12:19:20 UTC
MW output is not legal HTML. The tidy fix is wrong. Legal xhtml, but not the expected output.
Cases that tidy is able to fix are not-so-bad, but illegal tags that tidy screw are imho more important to fix in the parser (as tidy will stay).

Of course, what should be done is not providing illegal markup, and is the reason of the parser test.
My view is that when during a list, a block level element as <div is found in the same line, the list should be closed before outputtung the <div> i.e. what would do preg_replace("/(\*|#)(.*)(<div)/i", "\\1\\2\n\\3", $WikiText) on the beginning of parsing.

Any reasons to have lists of one-line <div>s?
Comment 4 Brion Vibber 2007-05-22 14:04:09 UTC
The general issue is that wiki lists are line-based markup, so a <div> that spans multiple lines is not considered legal, and the results are undefined.

Combine that with the ugly multi-pass parser, and it doesn't always come out pretty. :)
Comment 5 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-05-22 17:16:52 UTC
Probably an ideal solution would be to have multiline tags not terminate the list item until the tag is terminated, as expected.  I.e., it should produce <li><div>...</div></li>.  This is probably not something anyone wants to implement with the current parser, however.

Phrased that way, this seems to be a duplicate of bug 1581, which is a special case (and the most important one).  Probably makes most sense to dupe it to that.
Comment 6 Mark A. Hershberger 2011-04-12 16:15:23 UTC
Punting this to the new parser Brion has under development.
Comment 7 Mark A. Hershberger 2011-04-25 21:05:18 UTC
*** Bug 28691 has been marked as a duplicate of this bug. ***
Comment 8 p858snake 2011-04-30 00:09:49 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Comment 9 Sumana Harihareswara 2011-11-09 19:42:38 UTC
+need-review
Comment 10 Sam Reed (reedy) 2011-11-20 17:34:06 UTC
Killing both patch and need-review

It's a diff adding a parser test, which is to show the failure, although we could commit it now, but then we'd have failing parser tests showing up

So only wants committing when this bug is supposed to be fixed
Comment 11 Mark A. Hershberger 2012-01-30 16:49:24 UTC
*** Bug 33918 has been marked as a duplicate of this bug. ***
Comment 12 Nemo 2014-03-16 20:41:08 UTC
(In reply to Aryeh Gregor from comment #5)
> Probably an ideal solution would be to have multiline tags not terminate the
> list item until the tag is terminated, as expected.

This would also help bug 58429, which hits bug 1115 as well.

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


Navigation
Links