Set components.html height automatically

In the following minimal example, is it possible to set height parameter automatically to match the height of html content?

import streamlit.components.v1 as components

components.html(f"""<pre>{some_long_text}</pre>""", height=None) 

I have searched this similar question: https://discuss.streamlit.io/t/can-streamlit-components-v1-html-components-automatically-adjust-the-height/23522/1,
but I can not figure out a way to

programmatically determine how tall the content is

Thanks

up