Page MenuHomePhabricator

unwanted linebreak when output starts with #
Closed, ResolvedPublic

Description

{{#if:a| #ee2222|CornFlowerBlue}} introduces a linebreak before outputting #ee2222, causing the formation of a numbered list, but {{#if:a|bogus|CornFlowerBlue}} does not output a linebreak.


Version: unspecified
Severity: major
URL: http://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&oldid=353724342#Issue_with_switchs_and_colors

Details

Reference
bz23033

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:07 PM
bzimport added a project: ParserFunctions.
bzimport set Reference to bz23033.
bzimport added a subscriber: Unknown Object (MLST).

Note, as work around, {{#if:a| #ee2222|CornFlowerBlue}} works fine. (  -> space before it gets interperted as css.

This might be a duplicate Bug 12974 (that seems to be more to do with tables, but probably same underlying issue)

M8R-cyc3n3 wrote:

(In reply to comment #1)

Note, as work around, {{#if:a| #ee2222|CornFlowerBlue}} works fine. ( 
-> space before it gets interperted as css.

{{#if:a|<nowiki />#ee2222|CornFlowerBlue}} also works.

M8R-cyc3n3 wrote:

The usual behavior of the parser-function is to trim white-
space from its input, so I'd speculate #*:; are deliberate
exceptions to this, probably to _guarantee_ a line-break
with the following input, which may be a more common case:

List:{{#ifeq: {{{lang}}} | español |
#Uno
#Dos
#Tres
#Catorce
}}

Note: even without these symbols being a special case you
could preserve the otherwise eaten line-break manually by
putting "<nowiki />" at the end of the first line.

  • This bug has been marked as a duplicate of bug 12974 ***