Skip to content

Change where classes and other attributes are added in RedCloth definition lists #220

@jools-r

Description

@jools-r

When adding a (class-name) to the first item of a definition list, the HTML output is not consistent depending on the notation you use. The semicolon/colon notation places the classname on the containing dl element. The dash-colon-equals notation places the class name on the first dt element.

Expected behaviour

Consistent behaviour regardless of definition list notation used: the class should in my view be applied to the containing dl tag so that one can style the entire definition list. Currently using -Term := Definition notation you can only style the first dt.

Actual behaviour

See above

Additional information

PHP-Textile version: 3.7.6
PHP version: 8.1

Steps to reproduce

Try inserting the following into the textarea at textile-lang.com:

;(class-name) HTML
: HyperText Markup Language, based on SGML.
; XHTML
: HTML 4.0 rewritten to be compliant with XML rules.
; HTML5
: The latest revision of the HTML standard.
: Still under development.

-(class-name) HTML := HyperText Markup Language, based on SGML.
- XHTML := HTML 4.0 rewritten to be compliant with XML rules.
- HTML5 := The latest revision of the HTML standard
Still under development =:

The first ;(class-name) HTML produces what I think is correct output:

<dl class="class-name">
	<dt><span class="caps">HTML</span></dt>
        ...

while the second -(class-name) HTML := … produces

<dl>
	<dt class="class-name"><span class="caps">HTML</span></dt>
        ...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions