You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to highlight a long sentence (sentence greater than width parameter), except specific substring in the beginning of the text like below.
Code used:
answer = "As you can see, streamlit is an open-source Python library that makes it easy to create and share beautiful, custom web apps for machine learning and data science."
context = "Streamlit is an open-source Python library that makes it easy to create and share beautiful, custom web apps for machine learning and data science."
height = int(len(context)) * 0.3 + 30
annotated_text(answer.replace(context[0].lower() + context[1:], ""), (context[0].lower() + context[1:], "Longer", "#8cff66"))
As you see in the above image, the substring "As you can see" which I don't want to highlight is getting printed in a different line. This is happening because the sentence length is higher than the default line width of page.
But, the output I am expecting is something like this:
Conclusion:
I want to highlight a text longer than line width of page except the specific substring at the begin of the text. But I do not want that non-highlighted substring to be printed as a different line.
Is it possible to achieve this using st-annotated-text? Any help is appreciated.
Hi,
I am trying to highlight a long sentence (sentence greater than width parameter), except specific substring in the beginning of the text like below.
Code used:
As you see in the above image, the substring "As you can see" which I don't want to highlight is getting printed in a different line. This is happening because the sentence length is higher than the default line width of page.
But, the output I am expecting is something like this:
Conclusion:
I want to highlight a text longer than line width of page except the specific substring at the begin of the text. But I do not want that non-highlighted substring to be printed as a different line.
Is it possible to achieve this using st-annotated-text? Any help is appreciated.
@tvst
The text was updated successfully, but these errors were encountered: