Page MenuHomePhabricator

Inserting line break inside {{#tag:gallery}}
Closed, DeclinedPublic

Description

Hello! I've been trying to insert automatic wikidata generated image galleries but it seems that I can't insert a line break inside {{#tag:gallery}} using <br /> or otherwise. IS there any way to insert line breaks inside a tag? You can see the idea here: https://eu.wikipedia.org/wiki/Lankide:Theklan/Proba_orria

Event Timeline

In order to reproduce it:
{{#tag:gallery|
File:Giraffe Retouch.jpg
File:Giraffe Retouch.jpg
}}
works fine, but an auto generated list of files with
{{#tag:gallery|File:Giraffe Retouch.jpg<br />File:Giraffe Retouch.jpg}}
does not work.

There is a big different in syntax between a real newline and the html break <br />

What is your usecase?

The normal gallery tag also does not work with <br />

<gallery>
File:Giraffe Retouch.jpg<br />File:Giraffe Retouch.jpg
</gallery>

I would suggest to not change this behaviour

The fact is that I can't insert a newline without using <br /> and gallery tag doesn't work without new lines before every item. When I generate the list of items using a WD query (via Lua module) I get all the items and I must put each one in a new line... but this seems impossible as <br /> is the only option and <br /> doesn't work for the tag.

IS there any way to insert line breaks inside a tag?

Hi @Theklan. Wikimedia Phabricator/Maniphest is for bug reports and enhancement requests. Your question sounds instead like a support request (how to do something, etc.). So this task might be invalid and might be better located on the MediaWiki Support Desk instead? :)

I don't thik so @Aklapper! Is a problem with {{#tag:Gallery}} and MediaWiki new line handling.

Why you cannot output the newline in the lua module? Why is <br /> the only option? Add a new option to the lua module sounds easier than changing the mediawiki code (which can have side effects, when an file description contains <br/>)

As shown above in your example #tag:gallery works with newlines

Solved in the Lua module involved changing br tag to LF control character. It was just disconcerting. Thanks.