I’m using annotation from st-annotated-text and tried something like that:
st.markdown("### " + text + str(annotation("apple", "fruit")), unsafe_allow_html=True)
While the HTML seems perfectly fine, st.markdown struggled with parsing it (see image).
What can I do?
Looks like a bug with our HTML sanitizer. I created a new bug report for this here.
Is it possible to use annotations in a heading / in a list (possibly in conjunction with Markdown)?
I found out that the bug above goes away if you wrap everything in an single HTML element, thing render correctly. So the way to do what you want is something like this:
st.markdown("<h3>" + text + str(annotation("apple", "fruit")) + "</h3>", unsafe_allow_html=True)
Hi, Im using annotated_text
I have list of htmlelements to be passed to this method.
In list I have…
If I do annotated_text(htmlelement1, htmlelement2, htmlelement3), it works.
But since I have all these in list variable, I cannot do … What is the best way to do?