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:,
but I can not figure out a way to

programmatically determine how tall the content is