-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Literal square brackets are dropped when converting from markdown
to markdown
#8472
Comments
Well, it's tough to know how to deal with this. So of course it's a mess when you turn on this extension. In the case you note, we could have left off the backslash. But that's not always the case. Consider
Here we can't leave off the backslash, or we'd get a link, so there's no way to avoid the ambiguity introduced by |
Thanks for the quick reply. Is the recommended extension to use the double backslash one? Or to just use dollar signs for math? |
I prefer dollar signs, because that doesn't conflict with existing markdown syntax. |
Thanks. I was hesitant to use (You can see: it's highlighting in yellow the regions it thinks are math, which it naively thinks is "any region starting with I suppose I can tolerate the bad syntax highlighting (it's better than incorrectly rendered documents) so I'll do that in the mean time. Maybe I can even make my editor's highlighter better. If you still consider this a bug feel free to keep open. If you would rather close the ticket feel free. Thanks again for the quick responses. |
Explain the problem.
Converting from
markdown
tomarkdown
changes[1]
to\[1\]
:This is normally fine, however, if in the future you ever render that markdown file (which contains
\[1\]
) while also enabling thetex_math_single_backslash
extension, the[
and]
will get dropped in the HTML output:I use
-f markdown -t markdown
to clean up some poorly-formatted markdown generated outside of my control.I was hoping that I could change this to
-f markdown -t markdown+tex_math_single_backslash
to instruct pandoc that the markdown output should be compatible with\[
meaning "math", but it appears that's not how it works, and in fact no matter whether that extension is passed with the-t
flag, the output shows\[1\]
.Pandoc version?
macOS 12.6 Monterey
Apologies if this is expected, or if this is a duplicate of an existing issue (I searched, but nothing looked the same).
As always, thanks for this simple and excellent piece of software.
The text was updated successfully, but these errors were encountered: