Last modified: 2011-08-17 08:21:55 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 T18700, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16700 - Nesting templates lead to excess whitespace
Nesting templates lead to excess whitespace
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Low normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://test.wikipedia.org/wiki/Line-s...
: parser, patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-18 18:19 UTC by Mormegil
Modified: 2011-08-17 08:21 UTC (History)
3 users (show)

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


Attachments
Parser test showing the problem and the expected output (681 bytes, patch)
2008-12-18 18:19 UTC, Mormegil
Details
Patch solving the bug (979 bytes, patch)
2008-12-18 18:20 UTC, Mormegil
Details

Description Mormegil 2008-12-18 18:19:35 UTC
Created attachment 5594 [details]
Parser test showing the problem and the expected output

Some wikitext constructions depend on whether we are at the start of a line, or not. This is tracked using a flag called lineStart. However, the parser preprocessor loses track of this flag when a nested template is used.

See http://test.wikipedia.org/wiki/Line-start_flag_lost_when_nesting_templates – it uses {{Top-level template}}, which is only a call to {{Subtemplate}}. The parser thinks the list contained in {{Subtemplate}} is not at the line start (even though it is, in fact), so that (according to bug 529 behavior) it prepends a newline, which appears as a redundant paragraph on output.

If {{subtemplate}} is called directly, the paragraph disappears, and the output is correct.

See the attached parser test.
Comment 1 Mormegil 2008-12-18 18:20:55 UTC
Created attachment 5595 [details]
Patch solving the bug

My guess of the problem cause and an offered fix (I am not completely self-confident in parser/preprocessor code, though).
Comment 2 Siebrand Mazeland 2009-01-06 23:33:56 UTC
+need-review
Comment 3 DieBuche 2011-04-14 17:35:58 UTC
Please confirm:
http://translatewiki.net/w/i.php?title=Sandbox&oldid=2901073
Comment 4 Mormegil 2011-04-14 18:13:43 UTC
(In reply to comment #3)
> Please confirm:
> http://translatewiki.net/w/i.php?title=Sandbox&oldid=2901073

Actually, not at all, it just seems somebody broke the parser big time. Currently, numbered lists inside tables are just broken completely. See http://translatewiki.net/w/i.php?title=Sandbox&oldid=2901174

(And it did not help in the general case, either, it just seems like that at first sight. Check http://test.wikipedia.org/wiki/Line-start_flag_lost_when_nesting_templates for a numbered example, where the problem would still be obvious.
Comment 5 DieBuche 2011-04-14 18:46:39 UTC
Yep. That is fixed in r86064.
Comment 6 DieBuche 2011-04-14 18:58:43 UTC
Translatewiki just updated. Everything looks fine. For a some weird reason the parser test is still broken, evn though the output is fine. http://translatewiki.net/wiki/Sandbox
Comment 7 Mormegil 2011-04-14 19:09:07 UTC
(In reply to comment #6)
> Translatewiki just updated. Everything looks fine. For a some weird reason the
> parser test is still broken, evn though the output is fine.

It does not look fine at all (see http://translatewiki.net/wiki/Sandbox#Without_tables_because_of_the_currently_broken_parser). It just got worse in a more strange way, see http://translatewiki.net/wiki/Sandbox#Even_more_broken
Comment 8 DieBuche 2011-04-15 07:31:33 UTC
Ok, sorry for the false alarm.
Could you have a look again now?
Comment 9 Mormegil 2011-04-15 10:06:59 UTC
(In reply to comment #8)
> Could you have a look again now?

Yep, it looks better now (if it didn’t break something else ;-) ).
Comment 10 DieBuche 2011-04-15 10:21:39 UTC
I'll close it & will keep an eye on possible side effects.
Comment 11 DaSch 2011-08-17 08:21:55 UTC
For side effects check bug 30384

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


Navigation
Links