diff --git a/streamlit_server_state/server_state.py b/streamlit_server_state/server_state.py index d8f994e..1fa3455 100644 --- a/streamlit_server_state/server_state.py +++ b/streamlit_server_state/server_state.py @@ -8,6 +8,11 @@ class ServerState(collections.abc.MutableMapping): __items__: Dict[str, ServerStateItem] = {} + def _repr_html_(self): + # TODO: Escape to be HTML-safe as this is directly passed to + # TODO: st.markdown with unsafe_allow_html=True. + return dict(self) + def _ensure_item(self, k: str) -> ServerStateItem: if k in self.__items__: item = self.__items__[k]