From e343610732227f19f23bfc7ccda6bfb313803a1b Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Wed, 27 Mar 2019 07:19:21 +0100 Subject: [PATCH] Always use linux line breaks #208 --- jupytext/pandoc.py | 5 +++-- tests/test_read_simple_pandoc.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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)