aaren / notedown

Markdown <=> IPython Notebook
BSD 2-Clause "Simplified" License
855 stars 115 forks source link

Issue with Tables due to Linewrap #80

Open thomelane opened 6 years ago

thomelane commented 6 years ago

When exporting from Notebook to MD, the lines are wrapped to 80 characters. When the Notebook contains tables with rows longer than 80 characters, the lines are wrapped but this causes issues with how the table is rendered (Github for example). Most rendering assumes the wrapped line is a new row in the table, and the table is not rendered correctly.

Could a command line argument be added to allow setting the line wrap? On or off, or width?

Correct formatting (without line wrap):

| H1 | H2 |
|:---  |:---  |
|This is an example | Of what happens with line wrap |
H1 H2
This is an example Of what happens with line wrap

Incorrect formatting (with line wrap):

| H1 | H2 |
|:---  |:---  |
|This is an example | Of what
happens with line wrap |
H1 H2
This is an example Of what
happens with line wrap
geofflangenderfer commented 4 years ago

check out the call to wordwrap:

notedown/templates/markdown.tpl

{{ cell \| create_input_codeblock }}
--
5 | {% endblock input %}
6 |  
7 | {% block markdowncell scoped %}
8 | {{ cell.source \| wordwrap(80, False) }}
9 | {% endblock markdowncell %}

deleting the wordwrap call removes all wrapping in the output.