fix autoescaping issue for history