Fix self-enclosing tags boundaries detection