Last modified: 2012-06-27 14:34:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 11894 - Definition list nested with anything (;#foo:bar) is unpredictable
Definition list nested with anything (;#foo:bar) is unpredictable
Status: RESOLVED DUPLICATE of bug 6569
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2007-11-07 14:36 UTC by Steve Bennett
Modified: 2012-06-27 14:34 UTC (History)
1 user (show)

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


Description Steve Bennett 2007-11-07 14:36:36 UTC
Consider the parsing of these snippets:


// #2




Now, obviously it's far from clear what the semantics are or ought to be, but these aspects of behaviour are weird:

* In snippets #3 and #5, the definitions are rendered like the term itself.
* Snippets #1 and #2 render very differently although they should be equivalent.
* Snippet #4 is perhaps the most likely thing you'd actually want (one term with multiple definitions), but requires the most tortured syntax.
* #4 and #5 seem very similar but produce very output with different indenting and bolding.
* It's quite unfortunate that ";foo:bar" is supposed to act like ";foo<newline>:bar", but no attempt is made to render list elements like ";foo:#bar".

Most of this weirdness seems to be caused by the parser line around "if ($this->findColonNoLinks($t, $term, $t2) !== false)" which treats the part of the line after : as if it was actually a line starting with ;.

Possible resolutions:
* Don't allow any nesting of list items after ";". Treat ;#term as defining the literal string "#term". #; is fine for an ordered list of definitions.
* Make #5 above the canonical way to express a term with a list of definitions, but make it render as #4 above.
* Longer term, totally scrap the ";definition:term" (without newline) syntax. It's not of enormous benefit, makes the parsing more complex, and causes all this weird behaviour.
Comment 1 Gabriel Wicke 2012-06-27 14:34:18 UTC
This is resolved in Parsoid by making the single-line ; foo : bar pair a tightly-bound unit. See bug #6569 for more information about the reasoning.


*#; foo : bar

is treated as equivalent to

*#; foo
*#: bar

Extra ':' in the dd part are recognized as plain text in Parsoid.

We added tests documenting this behavior to parserTests.txt, but are marked the differing ones as disabled for the PHP parser until that becomes compatible.

*** This bug has been marked as a duplicate of bug 6569 ***

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