1. It sort of worked for me by removing the /sockclose command.

2. Maybe use this custom identifier to strip the HTML tags, to make life a little easier.

Code:
alias -l html {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}