The following XWiki 2.0 syntax:
(notice that we have to escape the ~, otherwise the URL of the external image is badly parsed) generates this HTML comment:
As expected, ~ is not escaped because the escaping was specific to XWiki 2.0 syntax (~ is not necessarily a special symbol in other syntaxes). When this HTML comment is transformed back to XWiki 2.0 syntax (e.g. when saving the page in WYSIWYG mode) the result is:
As you can see ~ not escaped anymore and the image URL is badly parsed as a result.