Introduced by e9d7504. This regression caused link and image references containing raw tex not to parse correctly. Added test. Closes #2150.
e9d7504