UI: Fix multiple thinking blocks rendering as raw text in HTML generator

This commit is contained in:
oobabooga 2026-03-13 15:47:11 -03:00
parent e0a38da9f3
commit aab2596d29

View file

@ -369,8 +369,10 @@ def convert_to_markdown(string, message_id=None):
if not text.strip():
return
thinking_content, remaining = extract_thinking_block(text)
if thinking_content is not None:
while text.strip():
thinking_content, remaining = extract_thinking_block(text)
if thinking_content is None:
break
has_remaining = bool(remaining.strip()) or not is_last_segment
html_parts.append(build_thinking_block(thinking_content, message_id, has_remaining, think_idx))
think_idx += 1