Topic on Project:Support desk

Transcluding text in an ordered/unordered list breaks if the translcluded page uses <noinclude>

6
209.119.37.71 (talkcontribs)

I have a problem using templates in lists. I am by no means a power user or wiki guru, so perhaps I am doing something fundamentally wrong. But here's the deal:

I can define a template and then include that template in a simple ordered or unordered list, like this:

  1. Template text
  2. regular text
  3. ...

so if my Template:template_text has "foo" then I get

1. foo 2. regular text 3. ...

BUT if Template:template_text contains category code, the list breaks. E.g.,

Template:template_text foo [[Category:bar]]

then I get 1. foo

1. regular text 2. ...

This is because the generated html now ends the list tag for the template text:

<ol><li> foo
</li></ol>
<p><br />
</p>
<ol><li> Regular text
</li>
<li> ...
</li></ol>

(It also sticks in the paragraph and break tags to be even more annoying).

I've tried the tag but that doesn't help.

It's not the end of the world but unless I'm doing something stupid this seems like an annoying bug, as it prevents me from putting my text fragments in categories, which is a really nice thing.

209.119.37.71 (talkcontribs)

Sorry, guess I can't edit my own posts:

In the first example above my wiki code looks like:

# {{Template:template_text}}
# regular text
# ...
209.119.37.71 (talkcontribs)

Ok REALLY sorry for the noise. Upon further testing, I'm pretty sure it is the "noinclude" tag that is causing the problem. Everything I said above is correct but the issue is that having the

<noinclude>
[[Category: My Cat]]
</noinclude>

section in my template causes lists to break when those lists transclude that template.

Sorry I can't provide a link, as our wiki instance is behind a firewall.

209.119.37.71 (talkcontribs)

Ok never mind. Sorry, I recreated the template and the problem went away. I must have had tabs or line breaks or something in the original template text that was confusing the html parser.

My bad for not thoroughly testing this before whining.

Ron Barker (talkcontribs)

Hi You can edit your own posts. Click on 'More' on the righthand side near the 'reply button'

Jjjjjjjjjj (talkcontribs)