Page MenuHomePhabricator

extra newlines in nested templates in tables [parser difference between 1.17 and 1.18]
Closed, ResolvedPublic

Description

Author: dasch

Description:
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


Version: 1.18.x
Severity: normal

Details

Reference
bz30384

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 21 2014, 11:52 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz30384.
bzimport created this task.Aug 15 2011, 3:53 PM
brion added a comment.Aug 15 2011, 5:19 PM

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.

dasch wrote:

The most helpful community I ever met -.-
And somehow nobody else had any problems before, strange thing

BTW: I removed the ad… my princess

Brion Vibber is MY princess. Hands off!

brion added a comment.Aug 15 2011, 5:31 PM

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.

dasch wrote:

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

dasch wrote:

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

(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?

(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".

dasch wrote:

The newline behaviour of templates is really strange
Is there a possibility to configure the behaviour?

dasch wrote:

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?

(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).

dasch wrote:

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

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.

dasch wrote:

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

dasch wrote:

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

dasch wrote:

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

dasch wrote:

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

dasch wrote:

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

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.

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.

dasch wrote:

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

changing version field to 1.18 since that's one it was introduced.

Raising priority since, re bawolff in IRC, this would cause problems if we made 1.18 live on wikipedia now.

dasch wrote:

Fix

This would fix the bug, reverting the changes in the parser
Taken from my wiki, there now everything works as it should

Attached:

after this discussion, I'm asking Tim to look at this.

The patch is essentially just a revert of r86072 except that it doesn't revert (and would hence break) the parser tests.

aaron added a comment.Sep 12 2011, 7:17 PM

(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.