Closed Bug 611729 Opened 14 years ago Closed 14 years ago

Including a one-line template in a list should not break out of the list

Categories

(support.mozilla.org :: Knowledge Base Software, task, P3)

Tracking

(Not tracked)

VERIFIED WORKSFORME

People

(Reporter: scoobidiver, Assigned: jsocol)

Details

If you have this syntax in an article:
# item 1
#[T:template]
# item 2
It renders as follow:
1. item 1
2. content of template
1. item 2
Component: General → Knowledge Base Software
QA Contact: general → kb-software
There is another example of numbered list reset:
# item 1
* item 2
# item 3
It renders as follow:
1. item 1
o  item 2
1. item 3
Summary: Numbered list should not be reset after a template → Numbered list should not be reset after a template or an unordered list
Target Milestone: --- → 2.3
(In reply to comment #1)
> There is another example of numbered list reset:
> # item 1
> * item 2
> # item 3
> It renders as follow:
> 1. item 1
> o  item 2
> 1. item 3
This one seems like expected behavior to me?
(In reply to comment #2)
> (In reply to comment #1)
> > There is another example of numbered list reset:
> > # item 1
> > * item 2
> > # item 3
> > It renders as follow:
> > 1. item 1
> > o  item 2
> > 1. item 3
> This one seems like expected behavior to me?

Yeah, I'd agree. If you didn't want it to reset, you'd use:

# item 1
#* item 2
# item 3

Which *should* render like this:

1 item 1
  o item 2
2 item 3
If you need to start numbering for a list at a number other than 1, you can do it in HTML: (Yay HTML5!)

<ol start="3">
<li>Item 3</li>
</ol>

Comment 0 probably depends highly on the contents of the template.
> This one seems like expected behavior to me?
In that case, the migration script must fix existing wrong syntax for nested list.

> Comment 0 probably depends highly on the contents of the template.
In that case, template is composed of one line with {for}. There is no list inside.
(In reply to comment #5)
> > This one seems like expected behavior to me?
> In that case, the migration script must fix existing wrong syntax for nested
> list.

AIUI, it does. Please leave a comment on bug 586487 with a specific example that's not converting correctly.

> > Comment 0 probably depends highly on the contents of the template.
> In that case, template is composed of one line with {for}. There is no list
> inside.

I wonder if a trailing newline might be causing issues. Definitely this should work:

* Item
* [[Template:one-liner]]
* Item 2
Priority: -- → P3
Summary: Numbered list should not be reset after a template or an unordered list → Including a one-line template in a list should not break out of the list
Assignee: nobody → james
OK, here's what I did:

Created an article called "Template:oneliner" with the following content (between the ======s):

======
This is a ''one line'' {for mac}Mac{/for}{for not mac}not Mac{/for} '''template'''.
======

Created an article called "uses oneliner" with the following content:

======
* a
* list
* [[Template:oneliner]]
* goes
* here

# a
# list
# [[Template:oneliner]]
# goes
# here
======

And it rendered as:

======
      <ul><li> a
</li><li> list
</li><li> This is a <em>one line</em> <span style="display: none;" class="for" data-for="mac">Mac</span><span class="for" data-for="not mac">not Mac</span> <strong>template</strong>.

</li><li> goes

</li><li> here
</li></ul>
<ol><li> a
</li><li> list
</li><li> This is a <em>one line</em> <span style="display: none;" class="for" data-for="mac">Mac</span><span class="for" data-for="not mac">not Mac</span> <strong>template</strong>.

</li><li> goes

</li><li> here
</li></ol>
======

Which is absolutely correct.

Then, to kick it up a notch, I changed "Template:oneliner" and made it include a list of its own. It still rendered the complete contents of the template inside the <li> of the list in "uses oneliner" (the list in the template became a sublist following the paragraph).

If there's a specific template that's causing problems, let me know, but afaict, this all works perfectly.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.