Topic on Project:Support desk

Infobox template adding line break

5
Danny252 (talkcontribs)

A recently infobox template is adding a <br /> tag after itself when included on a page on our wiki, resulting in the first line of an article being blank when included at the top of the page. For example, compare the top of the infobox to the top of the first line: http://www.svrwiki.com/GWR_2857_Heavy_Goods_Loco

This doesn't occur on other wikis with infoboxes. I can't pin down where the line break is originating from - as far as I can see, Mediawiki adds <p> tags when two or more new lines exist, not <br />. My main suspicion would be some dodgy CSS, but that shouldn't be adding HTML. Any thoughts?

Ciencia Al Poder (talkcontribs)

On the infobox template page, there's an HTML comment with Sample infobox to copy & paste. Can you put that inside a <noinclude>? Starting just at the end of the table. Sometimes MediaWiki uses br when there's interaction with tables

Danny252 (talkcontribs)

A good idea, but sadly it doesn't seem to have fixed it. I do have a suspicion it's a weird interaction with whitespace/comments somewhere, but I can't think of many more places to look for them!

Ciencia Al Poder (talkcontribs)

Hmmm, whitespace may be very sensible here... Looking at the expanded wikitext, it looks like there's still an extra newline between the table and the text:

Try to put the <noinclude> just next to the end of table ("|}"), on the very same line.

Danny252 (talkcontribs)

There we go, that was where it was coming from! Thanks for your help.