Hopefully fairly straightforward. Perhaps worth saying that I don't think there's an equivalent of QString::toHtmlEscaped to use, or I'd do that. Test cases:
Thanks.