Possibility of extracting a `TextSpan` out of a text-only HTML?
Use case
Hi! Thanks for this amazing project, really saved us from a hassle of building an HTML parser :)
We have a use-case where we need to render a HTML text coming from the server as a TextSpan, so that we can insert it in a Text.rich() alongside other TextSpans. It's guaranteed from the server that the HTML text is a single paragraph containing only <b>, <i>, and <u> tags.
After looking through the library, I couldn't find an easy way to achieve this.
Proposal
Add an easy way to create a TextSpan from a BuildTree, instead of a full widget
The internal logic will build the TextSpan as needed. Can't you use HtmlWidget directly?
We're currently building a UI where it's important to know the per-line metrics for the text. Currently I'm doing this via TextPainter and passing the TextSpan to it. Now we want to add HTML support for the text that comes from the backend, which is guaranteed to be a single paragraph. We also add some other children to this textspan.
I can't use HtmlWidget directly since it'll build the text internally, so I can't attach to its text painter. I wanted to somehow be able to use the internal logic so that I can build just the TextSpan.
With enough inputs, I think it's possible to make the TextSpan builder logic independent. Maybe.