After diving into the streamlit components documentation, it became clear that rendering HTML code for the label parameter of the st.expander()
function is not supported.
Is there a way to work around this limitation?
My exact requirement is as follows:
from annotated_text import annotation
with st.expander(
markdown(context[:start_idx] + str(
annotation("**" + answer + "**", "ANSWER", "#ff0074"))
+ context[end_idx:)):
#some code
Currently, I am only able to achieve something like this