-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
commonmark with sourcepos doesn't work right with header nodes #7769
Comments
We were always adding an enclosing Div, even when the block admits attributes. Now the attributes are added to the block itself, unless it can't accept attributes (as with inlines). See jgm/pandoc#7769.
@jgm Tested nightly, works great, thanks a lot! |
@jgm I think something went wrong. I tried the new 2.17 version and got the following output: File:
|
Here it what I'm seeing with 2.17:
(Use native output instead of json for better readability.) I was confused until I realized that the nightly you meant was 23 days ago.
|
This is quite bizarre; I can't see any changes in the last 23 days that would be relevant. |
Oh! Looks like we need a new commonmark-pandoc release. |
@jgm Sorry I didn't mentioned that this was an old nightly, didn't thought about that, I was literally confused too cause I didn't saw any changes between the 23 days. Thanks a lot! 🚀 |
0.2.1.2 * Fix addition of sourcepos attributes to blocks (jgm/pandoc#7769). We were always adding an enclosing Div, even when the block admits attributes. Now the attributes are added to the block itself, unless it can't accept attributes (as with inlines). 0.2.1.1 * Don't collapse Para to Plain in task lists (#77). 0.2.1 * commonmark-pandoc.cabal: remove unneeded build-depend on containers. * Support wikilinks extension.
Explain the problem.
If I use
commonmark
all the header in the ast (abstract syntax tree (json)) will get the id in the attributes.If I use
commonmark+sourcepos
the upper div will get that id.After I read the documentation it seams to be incorrect:
[...]For elements that accept attributes, a data-pos attribute is added; [...]
A header actually does, this doesn't work.
File:
file.md
Actual (With sourcepos) (
pandoc --from commonmark_x+sourcepos --to json ./file.md | jq
)Actual (Without sourcepos) (
pandoc --from commonmark_x --to json ./file.md | jq
)Expected (With sourcepos) (
pandoc --from commonmark_x+sourcepos --to json ./file.md | jq
)Diff
Pandoc version?
What version of pandoc are you using, on what OS?
The text was updated successfully, but these errors were encountered: