trim the value of attributes, add extractAttributes option