https://bugzilla.wikimedia.org/show_bug.cgi?id=27039

           Summary: #ask and #show parser functions have leading and
                    trailing white space
           Product: MediaWiki extensions
           Version: any
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: Normal
         Component: Semantic MediaWiki
        AssignedTo: mar...@semantic-mediawiki.org
        ReportedBy: j...@angrymonkey.net.nz
                CC: jeroen_ded...@yahoo.com


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:

{{#forminput:form=CFFC News Entry|query string=namespace={{#show: CFFC News
Global Settings | ?CFFC News Namespace# -}}}}

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:

{{#forminput:form=CFFC News Entry|query string=namespace={{padleft:{{#show:
CFFC News Global Settings | ?CFFC News Namespace# -}}|0}}}}

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to