MDL-34171 qformat_gift: Fix edge case with special character escaping.