Skip to content

Commit d3ee6b6

Browse files
committed
fix: Nexus ordered list handling in BBCode conversion
1 parent 59a53b5 commit d3ee6b6

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

markdown_to_bbcode.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,7 @@ def parse_list_items(lines):
150150
while list_stack and indent < current_indent:
151151
parent_list, parent_indent, parent_type = list_stack.pop()
152152
if parent_type == 'ordered':
153-
if bbcode_type == 'nexus':
154-
parent_list.append(f"[olist]\n" + "\n".join(current_list) + "\n[/olist]")
155-
else:
156-
parent_list.append(f"[list=1]\n" + "\n".join(current_list) + "\n[/list]")
153+
parent_list.append(f"[list=1]\n" + "\n".join(current_list) + "\n[/list]")
157154
else:
158155
parent_list.append(f"[list]\n" + "\n".join(current_list) + "\n[/list]")
159156
current_list = parent_list
@@ -167,19 +164,13 @@ def parse_list_items(lines):
167164
while list_stack:
168165
parent_list, parent_indent, parent_type = list_stack.pop()
169166
if parent_type == 'ordered':
170-
if bbcode_type == 'nexus':
171-
parent_list.append(f"[olist]\n" + "\n".join(current_list) + "\n[/olist]")
172-
else:
173-
parent_list.append(f"[list=1]\n" + "\n".join(current_list) + "\n[/list]")
167+
parent_list.append(f"[list=1]\n" + "\n".join(current_list) + "\n[/list]")
174168
else:
175169
parent_list.append(f"[list]\n" + "\n".join(current_list) + "\n[/list]")
176170
current_list = parent_list
177171

178172
if list_type == 'ordered':
179-
if bbcode_type == 'nexus':
180-
return "[olist]" + "\n".join(current_list) + "\n[/olist]"
181-
else:
182-
return "[list=1]" + "\n".join(current_list) + "\n[/list]"
173+
return "[list=1]" + "\n".join(current_list) + "\n[/list]"
183174
else:
184175
return "[list]" + "\n".join(current_list) + "\n[/list]"
185176

0 commit comments

Comments
 (0)