Skip to content

Commit 1219082

Browse files
committed
Improve comment
1 parent f4a52f4 commit 1219082

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

shiny/ui/_markdown_stream.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,14 @@ async def _task():
141141
result = ""
142142
async with self._streaming_dot():
143143
async for x in content:
144-
# x _can_ be a TagChild, but it's most likely just a string (of
145-
# markdown), so optimize for that case
146144
if isinstance(x, str):
145+
# x is most likely a string, so avoid overhead in that case
147146
ui: RenderedDeps = {"html": x, "deps": []}
148147
else:
148+
# process_ui() does *not* render markdown->HTML, but it does:
149+
# 1. Extract and register HTMLdependency()s with the session.
150+
# 2. Returns a HTML string representation of the TagChild
151+
# (i.e., `div()` -> `"<div>"`).
149152
ui = self._session._process_ui(x)
150153

151154
result += ui["html"]

0 commit comments

Comments
 (0)