wip.py: fix convert_list non closing tags at the end
This commit is contained in:
parent
1dfb40d0b2
commit
e556ecdda7
|
@ -850,8 +850,7 @@ def convert_list(markdown_str):
|
||||||
|
|
||||||
# Find items
|
# Find items
|
||||||
for i in range(len(strlist)):
|
for i in range(len(strlist)):
|
||||||
if tyto.words_tags[13][0] in strlist[i] or \
|
if strlist[i] == "":
|
||||||
tyto.words_tags[13][1] in strlist[i]:
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# = and +
|
# = and +
|
||||||
|
@ -902,23 +901,21 @@ def convert_list(markdown_str):
|
||||||
|
|
||||||
# rank up
|
# rank up
|
||||||
if cur_rank > rank:
|
if cur_rank > rank:
|
||||||
for i in range(cur_rank - rank - 1):
|
for i in range(cur_rank - rank):
|
||||||
work_str += " "*(rank+i) + OPENING[rank_stack.append(UL)]
|
work_str += " "*(rank+i) + OPENING[state]
|
||||||
rank_stack.append(state)
|
rank_stack.append(state)
|
||||||
|
|
||||||
work_str += " "*rank + OPENING[state]
|
|
||||||
|
|
||||||
# rank down
|
# rank down
|
||||||
elif cur_rank < rank:
|
elif cur_rank < rank:
|
||||||
for i in range(rank - cur_rank - 1):
|
for i in range(rank - cur_rank):
|
||||||
work_str += " "*(rank-i-1) + CLOSING[rank_stack.pop()]
|
work_str += " "*(rank-i-1) + CLOSING[rank_stack.pop()]
|
||||||
|
|
||||||
work_str += " "*cur_rank + CLOSING[rank_stack.pop()]
|
|
||||||
|
|
||||||
work_str += " "*cur_rank + '<li>' + text + "</li>\n"
|
work_str += " "*cur_rank + '<li>' + text + "</li>\n"
|
||||||
|
|
||||||
work_str += " "*(cur_rank-1) + CLOSING[rank_stack.pop()]
|
|
||||||
|
|
||||||
|
for i in range(cur_rank):
|
||||||
|
work_str += " "*(cur_rank-i-1) + CLOSING[rank_stack.pop()]
|
||||||
|
|
||||||
return work_str
|
return work_str
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue