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

attributes commonmark extension swallows attributes #83

Open
not-my-profile opened this issue Dec 30, 2021 · 2 comments
Open

attributes commonmark extension swallows attributes #83

not-my-profile opened this issue Dec 30, 2021 · 2 comments

Comments

@not-my-profile
Copy link

Explain the problem.

$ printf '{x=3}' | pandoc -f commonmark+attributes -t native
[]
$ printf 'hello\n\n{x=3}' | pandoc -f commonmark+attributes 
<p>hello</p>

If there is nothing the attribute belongs to it is simply swallowed. I find this problematic since this way you are very unlikely to spot such mistakes. I would prefer the markup {x=3} to show up as plain text in the output so that you can spot the error while looking at the rendered output.

Pandoc version?
pandoc 2.16.2 on Linux

@jgm
Copy link
Owner

jgm commented Dec 30, 2021

This is an issue for jgm/commonmark-hs (commonmark-extensions), if anything.
I can transfer it there. But personally, I think the current behavior is fine.
With the change you recommend, {x=3} would sometimes be an attribute specifier and sometimes plain text, which strikes me as confusing.

@jgm jgm transferred this issue from jgm/pandoc Dec 30, 2021
@not-my-profile
Copy link
Author

not-my-profile commented Dec 30, 2021

Thanks for moving the issue! Well if there is nothing it can be attributed to it's not really an attribute specifier is it?

As far as I am aware any other malformed Markdown ends up in the output instead of being silently discarded. E.g. when TeX math contains an unknown command it's also preserved in the output instead of being silently discarded.

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