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

VERIFIED WORKSFORME

Status

support.mozilla.org
Knowledge Base Software
P3
normal
VERIFIED WORKSFORME
8 years ago
8 years ago

People

(Reporter: Scoobidiver (away), Assigned: jsocol)

Tracking

unspecified

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
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
(Reporter)

Updated

8 years ago
Component: General → Knowledge Base Software
QA Contact: general → kb-software
(Reporter)

Comment 1

8 years ago
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

Updated

8 years ago
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?

Comment 3

8 years ago
(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
(Assignee)

Comment 4

8 years ago
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.
(Reporter)

Comment 5

8 years ago
> 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.
(Assignee)

Comment 6

8 years ago
(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
(Assignee)

Updated

8 years ago
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)

Updated

8 years ago
Assignee: nobody → james
(Assignee)

Comment 7

8 years ago
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
Last Resolved: 8 years ago
Resolution: --- → WORKSFORME
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.