diff --git a/Commands/Insert Close Tag.plist b/Commands/Insert Close Tag.plist index 292a7d1..b16eb9d 100644 --- a/Commands/Insert Close Tag.plist +++ b/Commands/Insert Close Tag.plist @@ -18,10 +18,12 @@ end before = /(.*\n){#{line-1}}.{#{line_index}}/.match(doc)[0] +before.gsub!(/<[^>]+\/\s*>/i, '') + # remove all self-closing tags -if ENV.has_key? 'TM_HTML_EMPTY_TAGS' then +if ENV.has_key?('TM_HTML_EMPTY_TAGS') then empty_tags = ENV['TM_HTML_EMPTY_TAGS'] - before.gsub!(/<(#{empty_tags})\b[^>]*>|<[^>]+\/\s*>/i, '') + before.gsub!(/<(#{empty_tags})\b[^>]*>/, '') end # remove all comments