@@ -104,8 +104,7 @@ def add_html(
104104 content :str , # The HTML to send to the client (generally should include hx-swap-oob)
105105):
106106 "Send HTML to the browser to be swapped into the DOM"
107- res = to_xml (content )
108- xpost ('http://localhost:5001/add_html_' , data = dict (content = res ))
107+ xpost ('http://localhost:5001/add_html_' , data = dict (content = to_xml (content )))
109108
110109# %% ../nbs/00_core.ipynb
111110def del_msg (
@@ -149,7 +148,8 @@ def add_msg(
149148 try : json .loads (ot or '[]' )
150149 except : return "Code output must be valid json"
151150 if not sid : sid = find_msg_id ()
152- data = dict (content = content , placement = placement , sid = sid , ** kwargs )
151+ data = dict (placement = placement , sid = sid , ** kwargs )
152+ if content is not None : data ['content' ] = content
153153 return xpost ('http://localhost:5001/add_relative_' , data = data ).text
154154
155155# %% ../nbs/00_core.ipynb
@@ -180,7 +180,7 @@ def _umsg(
180180@delegates (_umsg )
181181def update_msg (
182182 sid :str = None , # sid (stable id -- pk) of message to update (if None, uses current message)
183- content :str | None = None , # Content of the message (i.e the message prompt, code, or note text)
183+ content :str | None = None , # Content of the message (i.e the message prompt, code, or note text)
184184 msg :Optional [Dict ]= None , # Dictionary of field keys/values to update
185185 ** kwargs ):
186186 """Update an existing message. Provide either `msg` OR field key/values to update.
0 commit comments