html escaping and added TeX escaping for relevant parts of the bibtext template. Fixes issue #2459. - Legacy-Id: 14711