Fixed errors when tag names have $ in them.

Noticed these in the Googlebot console
Merge pull request #6031 from guardian/500s

Fixed errors when tag names have $ in them.