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

round tripping escaped atx header syntax can result in headers where none were intended #7726

Closed
jjallaire opened this issue Dec 2, 2021 · 4 comments
Labels

Comments

@jjallaire
Copy link

jjallaire commented Dec 2, 2021

Consider this following markdown file headings.md:

- \# First-level heading

- \#\# Second-level heading

- \#\#\# Etc.

If we round trip this from JSON and back to markdown (using pandoc 2.16.2 on MacOS):

pandoc brackets.md --to json | pandoc --from json --to markdown

We get the following output:

-   \# First-level heading

-   ## Second-level heading

-   ##\# Etc.
@jgm
Copy link
Owner

jgm commented Dec 2, 2021

This is quite strange!

% pandoc -f native -t markdown
[Str "##",Space,Str "hi"]
## hi
% pandoc -f native -t markdown
[Str "###",Space,Str "hi"]
##\# hi

@jgm
Copy link
Owner

jgm commented Dec 2, 2021

This is due to l. 93 of T.P.Writers.Markdown.Inline, but I have to figure out why that's there!

@jgm
Copy link
Owner

jgm commented Dec 2, 2021

See commit 5a6399d and #6259.

@jgm jgm closed this as completed in 51f6f0e Dec 4, 2021
@jjallaire
Copy link
Author

Thanks!

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

No branches or pull requests

2 participants