TxStyle · Textile Documentation

The Textile Markup Reference for Textpattern


Enhanced lists

In Textile 2.0 you were only permitted to put a class/ID/lang/style attribute on the very first item in the list, which applied the markup to the container.

Textile 2.2 lifts this restriction so you can now put the class/ID/lang/style modifiers on any list item; this works for ordered, unordered and definition lists.

The current behaviour is retained if you put the item on the first element, i.e.:

#(class#id) Item 1
# Item 2
# Item 3

Renders:

<ol class="class" id="id">
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ol>

If you also wish to put a class on individual items in the list you simply make the first list item end with a ‘.’ dot immediately after the attributes. That holds the ‘container’ modifiers, and then proceed as normal. viz:

#(class#id).
#(first) Item 1
#(second) Item 2
#(third) Item 3

Gives:

<ol class="class" id="id">
  <li class="first">Item 1</li>
  <li class="second">Item 2</li>
  <li class="third">Item 3</li>
</ol>

IMPORTANT: Due to the way the lists are processed, you need a ‘.’ after the attributes of your ‘empty’ list item to trigger the correct behaviour.

If you don’t want to add a class to the container, just use: #. as the first item — don’t forget the dot!

(from the Textile 2.2 release notes)




PHP Textile v3.7.0