Peter,
I can imagine there is a nicer way to do what you want. Anyway look in ad_text_html_covert and related procedures in packages/acs-tcl/tcl/text-html-procs.tcl
I looked into this before and I am pretty sure the conversion procedures are causing it.