If you convert this XHTML:
to XWiki 2.0 syntax, you get:
which is the expected result. But if you convert:
As you can see the fragment identifier is escaped. This breaks the links. Note that in both previous examples the link markers are missing. If I add the link markers to the second example it works:
The use case for the missing markers is when you import an office document that has internal links (e.g. a table of contents).