Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jools-r opened this issue May 2, 2022 · 2 comments

Comments

@jools-r
Copy link
Contributor

jools-r commented May 2, 2022

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>
        ...
@gocom
Copy link
Member

gocom commented May 3, 2022

Unfortunately, both are expected results covered by fixtures and not bugs:

https://github.com/textile/php-textile/blob/master/test/fixtures/basic.yaml#L2229
https://github.com/textile/php-textile/blob/master/test/fixtures/basic.yaml#L2243

The other one is simplified RedCloth syntax. The output of one could be changed, but because of b/c break, earliest it could be done is in 4.0.0.

@gocom gocom added this to the 4.0.0 milestone May 3, 2022
@gocom gocom changed the title Definition lists: classes applied differently to dl / first dt depending on notation used Change where classes and other attributes are added in RedCloth definition lists May 3, 2022
@jools-r
Copy link
Contributor Author

jools-r commented May 3, 2022

Oh, you are right. I didn't realise that is the current behaviour of the Redcloth syntax. Thanks for the clarification. And I think your suggestion of adding it to the next major version is good.

@gocom gocom modified the milestones: 4.0.0, 5.0.0 Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants