diff --git a/md2zhihu/__init__.py b/md2zhihu/__init__.py index 14a7b65..fc05022 100644 --- a/md2zhihu/__init__.py +++ b/md2zhihu/__init__.py @@ -185,15 +185,16 @@ def to_plaintext(mdrender, rnode): return [escape(n['text'])] -def table_to_barehtml(mdrender, rnode): +def table_to_barehtml(mdrender, rnode) -> List[str]: # create a markdown render to recursively deal with images etc. mdr = MDRender(mdrender.conf, platform=importer) md = mdr.render_node(rnode) md = '\n'.join(md) - tablehtml = k3down2.convert('table', md, 'html') - return [tablehtml, ''] + table_html = k3down2.convert('table', md, 'html') + table_html = table_html.split("\n") + [''] + return table_html def table_to_jpg(mdrender, rnode): diff --git a/test.sh b/test.sh index dad7522..48e2ddb 100755 --- a/test.sh +++ b/test.sh @@ -10,4 +10,5 @@ python setup.py install # PYTHONPATH="$(cd ..; pwd)" pytest -x -v # PYTHONPATH="$(cd ..; pwd)" pytest -x -v -k test_simple -PYTHONPATH="$(cd ..; pwd)" pytest -x -v --show-capture=all -k test_minimal_mistake +# PYTHONPATH="$(cd ..; pwd)" pytest -x -v --show-capture=all -k test_minimal_mistake +PYTHONPATH="$(cd ..; pwd)" pytest -x -v --show-capture=all -k test_github