From e556ecdda7f3a89203a489ea218f2316702a4c08 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Mon, 10 Apr 2023 19:20:04 +0200 Subject: [PATCH] wip.py: fix convert_list non closing tags at the end --- src/var/lib/tyto/program/wip.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index 1784fd9..df3ab4d 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -850,8 +850,7 @@ def convert_list(markdown_str): # Find items for i in range(len(strlist)): - if tyto.words_tags[13][0] in strlist[i] or \ - tyto.words_tags[13][1] in strlist[i]: + if strlist[i] == "": continue # = and + @@ -902,23 +901,21 @@ def convert_list(markdown_str): # rank up if cur_rank > rank: - for i in range(cur_rank - rank - 1): - work_str += " "*(rank+i) + OPENING[rank_stack.append(UL)] - rank_stack.append(state) - - work_str += " "*rank + OPENING[state] + for i in range(cur_rank - rank): + work_str += " "*(rank+i) + OPENING[state] + rank_stack.append(state) # rank down 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 += " "*cur_rank + CLOSING[rank_stack.pop()] - + work_str += " "*cur_rank + '
  • ' + text + "
  • \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