Describe the bug
In 0.42.12, attributes added with the Attributes Extension were applied to both the pre and code elements of code blocks. In 0.50.40, the same Markdown seems to only apply the attributes to the pre element, and I can't seem to find a way to get them applied to the inner code element.
This is a problem, as there is no way to apply additional attributes to code blocks in such a way that Javascript selectors can use them (such as for configuring a JS-based syntax highlighter). For example, the typical selector for finding code blocks of a particular language from Markdown is something like pre code[class='language-run-kotlin'], selecting the inner code element, but the configuration attributes are not available to the element that is selected.
To Reproduce
In 0.42.12, the following snippet would apply the attributes to both the
```run-kotlin
fun main() {
println("Running from Kotlin Playground!")
}
```
{theme='darcula' lines='true'}
Expected behavior
Attributes are applied to both the pre and code elements, to be compatible with the 0.42.12 version. The following snippet is how the sample input above was rendered on 0.42.12.
<pre theme="darcula" lines="true"><code class="language-run-kotlin" theme="darcula" lines="true">fun main() {
println("Running from Kotlin Playground!")
}
</code></pre>
Resulting Output
Attributes are only applied to the pre element, which is incompatible with 0.42.12. The following snippet is how the sample input above is rendered on 0.50.40.
<pre theme="darcula" lines="true"><code class="language-run-kotlin">fun main() {
println("Running from Kotlin Playground!")
}
</code></pre>
Describe the bug
In 0.42.12, attributes added with the Attributes Extension were applied to both the
preandcodeelements of code blocks. In 0.50.40, the same Markdown seems to only apply the attributes to thepreelement, and I can't seem to find a way to get them applied to the innercodeelement.This is a problem, as there is no way to apply additional attributes to code blocks in such a way that Javascript selectors can use them (such as for configuring a JS-based syntax highlighter). For example, the typical selector for finding code blocks of a particular language from Markdown is something like
pre code[class='language-run-kotlin'], selecting the innercodeelement, but the configuration attributes are not available to the element that is selected.ParserHtmlRendererFormatterFlexmarkHtmlParserDocxRendererPdfConverterExtensionTo Reproduce
In 0.42.12, the following snippet would apply the attributes to both the
Expected behavior
Attributes are applied to both the
preandcodeelements, to be compatible with the 0.42.12 version. The following snippet is how the sample input above was rendered on 0.42.12.Resulting Output
Attributes are only applied to the
preelement, which is incompatible with 0.42.12. The following snippet is how the sample input above is rendered on 0.50.40.