Do you think it'd be worth wrapping this up into `prepare_html()` and `prepare_text()` subs?