Page MenuHomePhabricator

#ask and #show parser functions have leading and trailing white space
Closed, ResolvedPublic

Description

Author: jwm

Description:
Background: I'm using a global setting page for a news package, and one of the setting set on that page is the namespace for new news entries.

The news entry form is set up thus:

The problem is, the output form looks like this:

<p><input type="text" name="page_name" size="25" value="" class="formInput" />
<input type="hidden" name="form" value="CFFC News Entry">
<input type="hidden" name="namespace" value="&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;News" />
<input type="submit" value="Create or edit" /></p>
<p> </form>

All that leading noise in the namespace value results in a page name that can't be created.

The ideal solution would be to have #show, at least, strip leading and trailing white space, however that may have formatting consequences for people who've written, “some text{{#show: ...}}some other text”, and had white space inserted.

For the time being, a work around I'm using is to pack the #show inside padleft, with the padding set to zero:


Version: unspecified
Severity: minor

Details

Reference
bz27039

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:18 PM
bzimport set Reference to bz27039.

What version of SMW are you using? Can you link to where this is occurring? If not, can you replicate it on a public wiki?

jwm wrote:

Semantic Bundle Version 0.6.20101202, so SMW 1.5.4. I see I'm out of date!

Here's a test page:

http://chch.ultimate.org.nz/wiki/view/User:Jwm/sandbox

I'll upgrade in the next day and test again.

SMW 1.5.4 contained a whitespace issue, which has been fixed in 1.5.5.