-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Markdown writer not escaping quotes within JSON #5369
Comments
Can you post a minimal sample ipynb file that is converted to the markdown you posted? |
Sure thing 👍 Here's the contents of an ipynb file
it has two cells, each of which has two tags. (above the metadata for each cell is in a "metadata" key. when I convert it to markdown with
it outputs this: ---
jupyter:
kernelspec:
display_name: Python 3
language: python
name: python3
language_info:
codemirror_mode:
name: ipython
version: '3.0'
file_extension: '.py'
mimetype: 'text/x-python'
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: '3.6.5'
nbformat: 4
nbformat_minor: 2
---
::: {.cell .markdown tags="["one","two"]"}
This cell has metadata
:::
::: {.cell .code execution_count="2" tags="["three","four"]"}
\``` {.python}
print("This code cell has metadata")
\```
::: {.output .stream .stdout}
This code cell has metadata
:::
::: (backslashes at the start of code fences are mine, I added them so github would render it) |
Thanks! Surprisingly, this appears to be a problem with the markdown writer:
|
Pandoc version: 2.7.1
OS: ubuntu latest
I'm playing around with converting
.ipynb
format to markdown, and ran into a snag that I think is because Pandoc is embedding JSON in a string but is not escaping the quotes characteres.When converting ipynb to markdown, I noticed that double-quotes were being used within the contents the metadata, like so:
::: {.cell .markdown tags="["heresatag"]"}
This was confusing the subsequent writer, which didn't correctly parse the contents of
tags=
because of the double-quotation marks.Is there a way that we could escape the inner quotation marks so that they don't mess up the conversion?
The text was updated successfully, but these errors were encountered: