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

footnote XML output contains <<unknown>> tags #23

Open
zkamvar opened this issue Mar 28, 2023 · 2 comments
Open

footnote XML output contains <<unknown>> tags #23

zkamvar opened this issue Mar 28, 2023 · 2 comments

Comments

@zkamvar
Copy link

zkamvar commented Mar 28, 2023

(edit: not sure how the reprex lost its formatting, but I fixed it)

The new footnotes feature might be useful for us at {tinkr}, but I'm not sure how to parse them as each footnote contains identical tags.

from: ropensci/tinkr#92 (comment)

txt <- c("a statement[^1][^2]\n", "[^1]: this is true", "[^2]: this is false")
commonmark::markdown_xml(txt, footnotes = TRUE) |> writeLines()
#> <?xml version="1.0" encoding="UTF-8"?>
#> <!DOCTYPE document SYSTEM "CommonMark.dtd">
#> <document xmlns="http://commonmark.org/xml/1.0">
#>   <paragraph>
#>     <text xml:space="preserve">a statement</text>
#>     <<unknown> />
#>     <<unknown> />
#>   </paragraph>
#>   <<unknown>>
#>     <paragraph>
#>       <text xml:space="preserve">this is true</text>
#>     </paragraph>
#>   </<unknown>>
#>   <<unknown>>
#>     <paragraph>
#>       <text xml:space="preserve">this is false</text>
#>     </paragraph>
#>   </<unknown>>
#> </document>

Created on 2023-03-22 with reprex v2.0.2

@jeroen
Copy link
Member

jeroen commented Mar 28, 2023

Ew that's weird. Posted it upstream here: github/cmark-gfm#316

@zkamvar
Copy link
Author

zkamvar commented Apr 17, 2024

I've added a potential fix for this in github/cmark-gfm#362, but I'm not sure how active the maintainers are there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants