[Mediawiki-l] Whitspace dropped from my template?

4 views
Skip to first unread message

Richard

unread,
Mar 23, 2012, 12:07:52 PM3/23/12
to media...@lists.wikimedia.org
Hi,

I've been creating an infobox derived template:
<http://terminals.classiccmp.org/wiki/index.php/Template:Infobox_terminal>

In certain places in my template, I do things like conditionally include
separators like ", " (comma, space) when multiple values are supplied as
values to my template. In the final rendering on the page that
instantiates the template I get the comma, but not the space.

Here is an example of the template being used where the space was dropped:
<http://terminals.classiccmp.org/wiki/index.php/ADDS_1010>

Notice there is no space between "November," and "1976".

How can I preserve this space in the template expansion?

Thanks!
--
"The Direct3D Graphics Pipeline" -- DirectX 9 version available for download
<http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

_______________________________________________
MediaWiki-l mailing list
Media...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Jeremy Baron

unread,
Mar 23, 2012, 2:32:15 PM3/23/12
to lega...@xmission.com, MediaWiki announcements and site admin list
Hi,

On Fri, Mar 23, 2012 at 12:07, Richard <lega...@xmission.com> wrote:
> Here is an example of the template being used where the space was dropped:
> <http://terminals.classiccmp.org/wiki/index.php/ADDS_1010>
>
> Notice there is no space between "November," and "1976".
>
> How can I preserve this space in the template expansion?

How does one create an account on your wiki?

http://terminals.classiccmp.org/wiki/index.php?title=Special:UserLogin&type=signup
says:
> == Permissions errors ==
> You do not have permission to create this user account, for the following reason:
> The action you have requested is limited to users in the group: Administrators.

-Jeremy

Richard

unread,
Mar 27, 2012, 1:21:01 AM3/27/12
to media...@lists.wikimedia.org
To answer my own question, the whitespace was being consumed because
of the adjacent <noinclude> and <includeonly> style tags. It appears
that there are two ways you could solve this:

1) use &#x20; to get a space that isn't encoded as ' '
2) use <nowiki/> after the space so that the other tags see the
adjacent nowiki tag and not whitespace that they gobble up.

I used #1 and my template expands as expected now.


--
"The Direct3D Graphics Pipeline" -- DirectX 9 version available for download
<http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

_______________________________________________

Reply all
Reply to author
Forward
0 new messages