support for empty and closed tags