         else
           current_word += char
       when 'tag'
-        if current_word is '<script'
+        if is_script_tag current_word
           mode = 'script'
           current_word += char
         else if is_end_of_tag char

is_whitespace = (char)-> /^\s+$/.test char
is_tag = (token)-> /^\s*<[^>]+>\s*$/.test token
isnt_tag = (token)-> not is_tag token

class Match
  constructor: (@start_in_before, @start_in_after, @length)->

      when 'script'
        if is_end_of_tag char
          current_word += '>'
          if ends_in_end_script_tag current_word
            words.push current_word
            current_word = ''
            if is_whitespace char
