diff --git a/jupytext/pandoc.py b/jupytext/pandoc.py index 71dbb4697..ad785d52e 100644 --- a/jupytext/pandoc.py +++ b/jupytext/pandoc.py @@ -38,5 +38,6 @@ def md_to_notebook(text): def notebook_to_md(notebook): """Convert a notebook to its Markdown representation, using Pandoc""" - text = nbformat.writes(notebook) - return pandoc(u'--from ipynb --to markdown', text) + json = nbformat.writes(notebook) + text = pandoc(u'--from ipynb --to markdown', json) + return u'\n'.join(text.splitlines()) diff --git a/tests/test_read_simple_pandoc.py b/tests/test_read_simple_pandoc.py index 3c8e19a94..73e11039b 100644 --- a/tests/test_read_simple_pandoc.py +++ b/tests/test_read_simple_pandoc.py @@ -30,5 +30,5 @@ def test_pandoc_explicit(markdown='''::: {.cell .markdown} ::: '''): nb = jupytext.reads(markdown, 'md') - markdown2 = jupytext.writes(nb, 'md').replace('\r\n', '\n') + markdown2 = jupytext.writes(nb, 'md') compare(markdown, markdown2)