2

I'm using RedCloth to convert some textile text into html.

One particular scenario seems particularly apt for using definition lists.

With RedCloth, definition lists have this syntax (source):

- coffee := Hot and black
- tea := Also hot, but a little less black
- milk :=
Nourishing beverage for baby cows.

Cold drink that goes great with cookies. =:

I want to add the class "beverages" to that list (so that the generated code looks like <dl class="beverages">...). I've tried this:

(beverages)- coffee := Hot and black
...

I also tried:

-(beverage) coffee := Hot and black
-(beverage) tea := Also hot, but a little less black
...

This is the way you style the other lists (uls and ols) in textile, but it didn't work for dls. The text was rendered as a literal paragraph (<p>-(beverage) coffee := Hot and black</p>)

Is there a syntax for adding classes to definition lists in textile, or must I use raw html instead?

kikito
  • 51,734
  • 32
  • 149
  • 189
  • 1
    I assume you mean `class="foo"`? This is an HTML class. There is no such thing as a CSS class (although people mistakenly use the term to mean HTML class, CSS class selector, CSS selector and CSS rule-set — which makes it a really confusing term). – Quentin Feb 09 '11 at 10:27
  • Your assumption is correct (as per the example). I've removed "css" from the title & body. – kikito Feb 09 '11 at 11:19

2 Answers2

2

The old - :- syntax does not allow adding classes/ids, but the following will work:

;(defclass#defid) Lorem
: Lorem ipsum dolor sit amet

will produce

<dl class="defclass" id="defid">
    <dt>Lorem</dt>
    <dd>Lorem ipsum dolor sit amet</dd>
</dl>
sqwk
  • 2,649
  • 1
  • 28
  • 42
2

It is currently not possible to assign classes or ids to definition lists on textile.

I've created an issue for this here:

http://jgarber.lighthouseapp.com/projects/13054/tickets/208-classes-or-ids-cant-be-specified-in-definition-lists

kikito
  • 51,734
  • 32
  • 149
  • 189