Pass additional details to logger on XeLaTeX failures.

Requires Icafbc480be9173b33f1168d1d8adbfc1a3433c91

Change-Id: I468171dcd1b2a2a6087f94ef54110a4e5db6d590
Properly escape HTML anchors and id attributes.

<ref name="15%"> was causing issues because of the unescaped percent
symbol.  Add a test case including all the TeX special characters to
ensure we've fixed all variants of this bug.

Bug: 68854
Change-Id: Id7678159a906c40c90e49194aa9e331ce27ac1b9