Adapted to new markup escape/unescape mechanism, based on Unbescape.