2

我正在使用RedCloth将一些纺织文本转换为 html。

一种特殊情况似乎特别适合使用定义列表

使用 RedCloth,定义列表具有以下语法(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. =:

我想将“饮料”类添加到该列表中(以便生成的代码看起来像<dl class="beverages">...)。我试过这个:

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

我也试过:

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

这是您在纺织中设置其他列表(uls 和ols)的方式,但它不适用于dls。文本呈现为文字段落 ( <p>-(beverage) coffee := Hot and black</p>)

是否有将类添加到纺织品定义列表的语法,或者我必须使用原始 html 来代替?

4

2 回答 2

2

目前无法将类或 ID 分配给纺织品的定义列表。

我在这里为此创建了一个问题:

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

于 2011-03-06T10:43:57.670 回答
2

旧的 - :- 语法不允许添加类/ID,但以下将起作用:

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

会产生

<dl class="defclass" id="defid">
    <dt>Lorem</dt>
    <dd>Lorem ipsum dolor sit amet</dd>
</dl>
于 2014-06-11T21:06:39.533 回答