Skip to content

Commit deaed05

Browse files
committed
[WIP] Add ServerState._repr_html_
1 parent 1ea5585 commit deaed05

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

streamlit_server_state/server_state.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
class ServerState(collections.abc.MutableMapping):
99
__items__: Dict[str, ServerStateItem] = {}
1010

11+
def _repr_html_(self):
12+
return dict(self) # TODO: Escape to be HTML-safe as this is directly passed to st.markdown with unsafe_allow_html=True.
13+
1114
def _ensure_item(self, k: str) -> ServerStateItem:
1215
if k in self.__items__:
1316
item = self.__items__[k]

0 commit comments

Comments
 (0)