slang: update to account for document changes

also apply trimming on the input