mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-09 13:21:42 +00:00
fix(slack): keep blank-line-separated ordered items in one rich_text_list
When a Markdown ordered list has blank lines between items (common in LLM-authored content), the list run loop breaks on each blank line. Slack numbers each rich_text_list independently, so N items produce N lists each starting at 1. Skip blank lines inside the list run as soft separators instead of breaking, so ordered items stay in one rich_text_list and Slack renders the correct numbering. Fixes #57076
This commit is contained in:
parent
3a122ba4ac
commit
d3c8a155cb
2 changed files with 20 additions and 0 deletions
|
|
@ -451,6 +451,10 @@ def render_blocks(
|
|||
indent, ordered, txt = items[-1]
|
||||
items[-1] = (indent, ordered, txt + " " + lines[i].strip())
|
||||
i += 1
|
||||
elif not lines[i].strip():
|
||||
# blank line — soft separator within a list run;
|
||||
# skip so that ordered items stay in one rich_text_list.
|
||||
i += 1
|
||||
else:
|
||||
break
|
||||
blocks.append(_list_block(items))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue