jgm/commonmark-hs

`fenced_divs` doesn't support unbraced class names in commonmark

not-my-profile opened this issue · 6 comments

Explain the problem.

$ printf ':::test\n:::' | pandoc -f markdown+fenced_divs
<div class="test">

</div>
$ printf ':::test\n:::' | pandoc -f commonmark+fenced_divs
<p>:::test :::</p>

Pandoc version?
pandoc 2.16.2 on Linux

jgm commented

That's not valid syntax for fenced divs.
This works:

::: {.test}
hi
:::

Now I am very confused. The manual says:

Extension: fenced_divs
[..]
As with fenced code blocks, one can use either attributes in curly braces or a single unbraced word, which will be treated as a class name.

And indeed that is how fence_divs works with markdown:

$ printf ':::test\n:::' | pandoc -f markdown+fenced_divs
<div class="test">

</div>

Is it intentional that fenced_divs behaves differently in commonmark than in Markdown? If so it should at least be documented. (I updated the issue title and description.)

jgm commented

Reopening. Yes, you're right, the syntax was recently changed (#7242), but the commonmark-extensions library was not modified, only the pandoc Markdown parser. This introduces an inconsistency. See also c550bf8482310dfbcb20694e7bc969d19acc5f7d where the behavior of the writer was changed because of this.

I'll move this issue to commonmark-hs, because that's where the fix will have to go.

Thanks :) I didn't know about this repository. Maybe it's worth pinning an issue at the pandoc repository pointing out related repositories? Something like:

jgm commented

It's pretty easy for me to move them around...

Right ... it's just that I like to avoid creating duplicate issues.

It might also be worth highlighting some smaller dependencies since they might be more approachable for contributors.

I think it's a shame that GitHub doesn't let you show "related repositories" in the sidebar or something like that.