Skip to content

Commit

Permalink
fix #57
Browse files Browse the repository at this point in the history
  • Loading branch information
ickc committed May 20, 2021
1 parent 325978b commit 28c6ce1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pantable/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,9 @@ def parse_data_markdown(
# TODO: PY37
# if body_list and 'body' not in (last_body := body_list[-1]):
# last_body['body'] = temp
if body_list:
last_body = body_list[-1]
if 'body' not in last_body:
last_body['body'] = temp
last_body = body_list[-1] if body_list else None
if body_list and 'body' not in last_body:
last_body['body'] = temp
else:
body_list.append({'body': temp})
# is_body_head
Expand Down
18 changes: 18 additions & 0 deletions tests/files/md_codeblock/issue-57.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
``` {.table}
---
alignment: DLRL
markdown: true
fancy-table: true
...
===,,**asdfsadf**,,
,**asdfasdf**,asdfasd,180,safgafg
,,asdfa,90,asgadsfg
,,asdfsadf,40,asgasfg
,,zxcvxczv,1,asgsafg
___,,zxcvxczv,1,zxcvzxv
,**xzcvxczv**,zxcvzcxv,100,sdfgasg
,,sagfsg,40,asfg
,,asdgfasfg,70,adsfgbbvv
,,asgsadg,30,adfgfdg
___,,Edsafdsag,1,asfgsafg
```
12 changes: 12 additions & 0 deletions tests/files/md_codeblock_reference/issue-57.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**asdfsadf**
-------------- -------------- ----- -----------
**asdfasdf** asdfasd 180 safgafg
asdfa 90 asgadsfg
asdfsadf 40 asgasfg
zxcvxczv 1 asgsafg
zxcvxczv 1 zxcvzxv
**xzcvxczv** zxcvzcxv 100 sdfgasg
sagfsg 40 asfg
asdgfasfg 70 adsfgbbvv
asgsadg 30 adfgfdg
Edsafdsag 1 asfgsafg

0 comments on commit 28c6ce1

Please sign in to comment.