Ensure attributes are escaped when emitted
Handle carriage returns better