Skip to content

Commit

Permalink
Always use linux line breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Mar 27, 2019
1 parent 9800c20 commit e343610
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions jupytext/pandoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
2 changes: 1 addition & 1 deletion tests/test_read_simple_pandoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit e343610

Please sign in to comment.