Strip self-closing tags correctly.