Split off HTML conversion from UI