Skip to content

Commit 88b61fc

Browse files
committed
Fix IndexError on whitespace-only fence info during streaming
1 parent a9823fd commit 88b61fc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

openkb/agent/_markdown.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ def _render_block(node: Any) -> RenderableType | None:
5353
if t == "paragraph":
5454
return _render_inline_container(node)
5555
if t == "fence":
56-
lang = (node.info or "").strip().split()[0] if node.info else ""
56+
info_parts = (node.info or "").strip().split()
57+
lang = info_parts[0] if info_parts else ""
5758
return Syntax(
5859
node.content.rstrip("\n"),
5960
lang or "text",

0 commit comments

Comments
 (0)