Last modified: 2011-09-12 19:17:08 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 T32384, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30384 - extra newlines in nested templates in tables [parser difference between 1.17 and 1.18]
extra newlines in nested templates in tables [parser difference between 1.17 ...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.18.x
All All
: Highest normal (vote)
: ---
Assigned To: Tim Starling
: need-parsertest
Depends on:
Blocks: 29068
  Show dependency treegraph
 
Reported: 2011-08-15 15:53 UTC by DaSch
Modified: 2011-09-12 19:17 UTC (History)
7 users (show)

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


Attachments
Fix (1.31 KB, patch)
2011-08-17 09:32 UTC, DaSch
Details

Description DaSch 2011-08-15 15:53:28 UTC
Somehow the inclusion of templates adds many unwanted spaces or <pre> that are not defined in the template

http://www.wecowi.de/wiki/Rehgrabenh%C3%BCtte
http://www.wecowi.de/wiki/Albert_Einstein

I could not find where this error comes from, it's somehow a strange interpretation of the Wiki Code

changing the state of tidy does not change anything
Comment 1 Brion Vibber 2011-08-15 17:19:55 UTC
Site has some sort of interstitial ad thing that pops up new ad windows when you click "close" button; can't get in to test. Closing INVALID.
Comment 2 DaSch 2011-08-15 17:26:23 UTC
The most helpful community I ever met -.-
And somehow nobody else had any problems before, strange thing

BTW: I removed the ad… my princess
Comment 3 とある白い猫 2011-08-15 17:29:10 UTC
Brion Vibber is MY princess. Hands off!
Comment 4 Brion Vibber 2011-08-15 17:31:31 UTC
Thanks; your users will appreciate that as well.

It looks like your template:

http://www.wecowi.de/edit/Vorlage:Infobox_Person

has a lot of bits like this:

---
{{#if:{{{Wohnort|}}}|{{!}}style="vertical-align:top"{{!}}'''Wohnort:'''
{{!}}{{#arraymap:{{{Wohnort}}}|/|x|[[Wohnort::x]]|,&nbsp;}}
{{!-}}}}
{{#if:{{{Wahlheimat|}}}|{{!}}style="vertical-align:top"{{!}}'''Wahlheimat:'''
{{!}}{{#arraymap:{{{Wahlheimat}}}|,|x|[[Wahlheimat::x]]|,&nbsp;}}
{{!-}}}}
{{#if:{{{Abstammung|}}}|{{!}}style="vertical-align:top"{{!}}'''Abstammung:'''
{{!}}{{#arraymap:{{{Abstammung}}}|,|x|[[Abstammung::x]]}}
{{!-}}}}
---

If I'm not mistaken, that's going to leave a bunch of newlines, eg if none of those params are there:

---



---

Those newline sequences are going to end up interpreted as 'oh you want some extra lines between your paragraphs', I believe.

You might want to try removing the extra newlines outside of the if blocks, and see if that helps.
Comment 5 DaSch 2011-08-15 17:41:56 UTC
well, but isn't that the wron behaviour? The break between the #if's is only one and should not add breaks. That's the behaviour with normal wikitext I think
Comment 6 DaSch 2011-08-15 17:50:28 UTC
the most strange thing is, that the template in the first example is taken from wikipedia and behaves completly other way in my wiki then in wikipedia
Comment 7 Bawolff (Brian Wolff) 2011-08-15 17:53:59 UTC
(In reply to comment #6)
> the most strange thing is, that the template in the first example is taken from
> wikipedia and behaves completly other way in my wiki then in wikipedia

lol, with the #arraymap and all?
Comment 8 Bawolff (Brian Wolff) 2011-08-15 17:57:23 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > the most strange thing is, that the template in the first example is taken from
> > wikipedia and behaves completly other way in my wiki then in wikipedia
> 
> lol, with the #arraymap and all?

My apologies, I apparently don't know how to read the word "first".
Comment 10 DaSch 2011-08-15 18:16:07 UTC
The newline behaviour of templates is really strange
Is there a possibility to configure the behaviour?
Comment 11 DaSch 2011-08-16 08:47:30 UTC
I would like you to compare this two pages
http://www.wecowi.de/index.php?title=Brunnih%C3%BCtte&oldid=102220
http://de.wikipedia.org/w/index.php?title=Brunnih%C3%BCtte&oldid=92506027

The WikiText is identical, but in my wiki with MW 1.19 there is a break on top of the page. Was there anything changed in the parser in the newest Version?
Comment 12 Bawolff (Brian Wolff) 2011-08-16 17:49:44 UTC
(In reply to comment #11)
> I would like you to compare this two pages
> http://www.wecowi.de/index.php?title=Brunnih%C3%BCtte&oldid=102220
> http://de.wikipedia.org/w/index.php?title=Brunnih%C3%BCtte&oldid=92506027
> 
> The WikiText is identical, but in my wiki with MW 1.19 there is a break on top
> of the page. Was there anything changed in the parser in the newest Version?

It looks as if your template has an <includeonly> section containing an extra new line that is not present on the Wikipedia version.


Could you please include a small (minimal preferably 3 lines or less) example of the "weird" behaviour including wikitext, what the actual output is, what you expect it to be. So far most of your examples work for me (but that is hindered by the fact I don't really know what I'm looking for in them. I don't see any unexpected weird spaces when I look at the page).
Comment 13 DaSch 2011-08-16 17:55:17 UTC
Well I deleted a line between the text and template and saved the problem this way.
The point is, that in my wiki new lines in the wikitext are more often parsed as new lines, paragraphs or breaks as in wikipedia and there are often included
<p><br/></p> which is total nonsense
Comment 14 Bawolff (Brian Wolff) 2011-08-16 18:00:31 UTC
Two consecutive new lines make a line break - That's the way its always been (where new lines are added when #if's are involved gets a little confusing because often there is an implicit extra new line, but still the same principle applies). I think it is extremely unlikely we're going to change that behaviour, which as far as I can tell is what you're asking for.
Comment 15 DaSch 2011-08-16 18:04:11 UTC
The point why I opend this bug is, that after I deleted many new lines between the #if that where in the template in wikipedia the number of newlines in my wiki decresed, in wikipedia where I took the template from there where no unneeded new lines.
I'll try to isolate the problem and check under what cricumstances they appear

I set this to later until I know some more about the problem
Comment 16 DaSch 2011-08-16 20:26:12 UTC
I can not really find the problem, it's just strange that new lines that are not interpreted in wikipedia are printed as <p><br/></p> in my wiki
Comment 17 DaSch 2011-08-16 21:05:11 UTC
I have something to test the problem
Try this 

{| class=wikitable
| Some Text
{{!-}}
{{!}} Some Text

|-
| Some Text

{{!-}}
{{!}} Some Text

{{!-}}

{{!}} Some Text

|-

| Some Text
|}

On Wikipedia they are all displayed the same, on my wiki there are <p><br/></p> in den fourth and fifth although the templates are the same as in wikipedia
Comment 18 DaSch 2011-08-16 23:10:58 UTC
It's really anoying, I tryed tousend of combinations like you can see in the history
http://www.wecowi.de/history/Vorlage:Infobox_Schutzh%C3%BCtte
most of the changes adds not needed new lines or break the hole template
Comment 19 DaSch 2011-08-16 23:19:52 UTC
Wiki-Text of the Template is completly identical but the output is different!
http://www.wecowi.de/wiki/West-Nil-Virus
http://de.wikipedia.org/wiki/West-Nil-Virus
Comment 20 Bawolff (Brian Wolff) 2011-08-16 23:20:28 UTC
Re: Comment 17 - I can confirm that the rendering is different between vanilla MW 1.17 and trunk.

Not sure where this was introduced, last thing to touch the table stuff seems to be the adding of <thead> support. I'll test further to see if that could have accidentally caused this.
Comment 21 Bawolff (Brian Wolff) 2011-08-16 23:53:15 UTC
appears to be caused by r86072 (which means its in 1.18 as well). cc'ing diebuche.


marking as blocks 1.18 since I don't think such parser changes should be made without careful consideration/discussion/etc.
Comment 22 DaSch 2011-08-17 00:08:11 UTC
I think this changes should be reverted, it would break many templates in wikipedia an make it extremly difficult to make the wiki-text of templates readable
Comment 23 Bawolff (Brian Wolff) 2011-08-17 00:32:06 UTC
changing version field to 1.18 since that's one it was introduced.
Comment 24 Mark A. Hershberger 2011-08-17 01:35:14 UTC
Raising priority since, re bawolff in IRC, this would cause problems if we made 1.18 live on wikipedia now.
Comment 25 DaSch 2011-08-17 09:32:13 UTC
Created attachment 8931 [details]
Fix

This would fix the bug, reverting the changes in the parser
Taken from my wiki, there now everything works as it should
Comment 26 Mark A. Hershberger 2011-09-08 18:12:01 UTC
after this discussion, I'm asking Tim to look at this.
Comment 27 Roan Kattouw 2011-09-09 13:01:21 UTC
The patch is essentially just a revert of r86072 except that it doesn't revert (and would hence break) the parser tests.
Comment 28 Aaron Schulz 2011-09-12 19:17:08 UTC
(In reply to comment #21)
> appears to be caused by r86072 (which means its in 1.18 as well). cc'ing
> diebuche.
> 
> 
> marking as blocks 1.18 since I don't think such parser changes should be made
> without careful consideration/discussion/etc.

Reverted in r96887.

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


Navigation
Links