Jump to content

Topic on Extension talk:Poem/Archive 2

The =-sign within a text that's part of a poem embedded in a template.

4
Summary by Craft6789
{quote}=
<b,>
Willeeuwis (talkcontribs)

Willeeuwis (talk) 07:14, 11 May 2012 (UTC)

I have a simple template:

<div style="padding-left:20px; border-left:1px solid black">
<poem>
{{{1}}}
</poem>
</div>

When I write:

<poem>
1 + 1 = 2
</poem>

This results, as expected, in:

1 + 1 = 2

When write:

{{quote|1 + 1 = 2}}

This results in (with the lay out as decalred by the div style):

{{{1}}}

Writing:

{{quote|1 + 1 <nowiki>=</nowiki> 2}}

solves the problem, but why the difference. Is it the template that does this? Can this be "undone"?

Alex brollo (talkcontribs)

In general, the behavior of an extension tag as poem or ref included into a template is umpredictable (I suppose, from exoteric priorities into parsing). Often the issue is solved using #tag syntax instead of the extension tag. I.e. this solves the unpleasant issue of "a ref inside of a ref [1]</ref>".

Explore the #tag syntax if you did never do before! Alex brollo (talk)

first level references
  1. This is a first-level ref[a 1]:-)
second level references
  1. and this is a second-level ref template is umpand this is a third-level ref :-)
third level references
    Phil Boswell (talkcontribs)

    This is because when you write {{quote|1 + 1 = 2}} the parser thinks you wish to invoke {{quote}} with a single parameter named "1 + 1". If you have a named parameter, it does not get assigned a number: that's only for anonymous parameters. So {{{1}}} does not have a value, and you have not used a pipe to indicate a default value, so you get the raw parameter showing up as above.

    Willeeuwis (talkcontribs)

    Revisiting this, I saw that I never thanked you four helping me out. Better late than never: thanks :-)

    Reply to "The =-sign within a text that's part of a poem embedded in a template."