Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions streamlit_server_state/server_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down