I haven't tried this code, but wanted to mention that you should use https://www.renpy.org/doc/html/text.html#renpy.filter_text_tags to fix the text tag issue.
This will filter out text tags before you grab the first x characters :)
Oh and I should mention this as well: https://www.renpy.org/doc/html/other.html#renpy.substitute
You should use both to ensure you're not also accidentally cutting off variable substitutions (e.g. "Hey [name]" would be bad if it got cut off at "Hey [nam")
This can be accomplished in one line if necessary, e.g.
preview = renpy.substitute(renpy.filter_text_tags(TEXT_FOR_FILTERING, allow=[]))
Hope that helps!