MDL-36212 rework html entity conversions