escape < and & in attributes and use the same escape function for attributes in doc.stag