gettalong / kramdown

kramdown is a fast, pure Ruby Markdown superset converter, using a strict syntax definition and supporting several common extensions.
http://kramdown.gettalong.org
Other
1.72k stars 274 forks source link

`time` should be span level by default #794

Closed EtienneMiret closed 1 year ago

EtienneMiret commented 1 year ago

The below input:

Please, make sure you will be available               
<time datetime="2023-10-14">next Saturday</time>.

generates:

<p>Please, make sure you will be available</p>
<time datetime="2023-10-14">next Saturday</time>
<p>.</p>

(using kramdown 2.4.0 on ruby 3.2.2)

Which, well… is plain wrong.

Sure, the time element is not listed among the span level elements in the kramdown syntax, so this may be a new feature rather than a bug. Yet, those 3 lists (raw HTML, block-level elements and span-level elements) need to be updated each time the HTML standard is updated. At least until #793 is supported.

gettalong commented 1 year ago

Thanks for the report! The <time> element could also be a block-level element but I agree that in kramdown it makes more sense as span-level element. I have fixed this so that it results in:

<p>Please, make sure you will be available
<time datetime="2023-10-14">next Saturday</time>.</p>