anchor.diff:              lists:reverse(Acc);
           _ ->
               {Tag, S1} = tokenize(B, S),
  -            tokens(B, S1, [Tag | Acc])
  -    end.
  +            case parse_flag(Tag) of
  +                script ->
  +                    {Tag2, S2} = tokenize_script(B, S1),
  +                    tokens(B, S2, [Tag2, Tag | Acc]);
  +                textarea ->
  +                    {Tag2, S2} = tokenize_textarea(B, S1),
  +                    tokens(B, S2, [Tag2, Tag | Acc]);
  +                none ->
  +                    tokens(B, S1, [Tag | Acc])
  +            end
  +    end.
  +
  +parse_flag({start_tag, B, _, false}) ->
  +    case string:to_lower(binary_to_list(B)) of
  +        "script" ->
  +            script;
  +        "textarea" ->
  +            textarea;
  +        _ ->
  +            none
  +    end;
  +parse_flag(_) ->
  +    none.
   
   tokenize(B, S=#decoder{offset=O}) ->
       case B of
  
positive.code: 
  tokenize_charref(Bin, S=#decoder{offset=O}) ->
      tokenize_charref(Bin, S, O).
      
  tokenize_charref(Bin, S=#decoder{offset=O}, Start) ->
      case Bin of
          <<_:O/binary>> ->
  
negative.code:         tokens(<<"<foo bar=baz wibble='wibble' alice=bob/>">>),
      [{comment, <<"[if lt IE 7]>\n<style type=\"text/css\">\n.no_ie { display: none; }\n</style>\n<![endif]">>}] =
          tokens(<<"<!--[if lt IE 7]>\n<style type=\"text/css\">\n.no_ie { display: none; }\n</style>\n<![endif]-->">>),
      [{start_tag, <<"script">>, [{<<"type">>, <<"text/javascript">>}], false},
       {data, <<" A= B <= C ">>, false},
       {end_tag, <<"script">>}] =
          tokens(<<"<script type=\"text/javascript\"> A= B <= C </script>">>),
      [{start_tag, <<"textarea">>, [], false},
       {data, <<"<html></body>">>, false},
       {end_tag, <<"textarea">>}] =
          tokens(<<"<textarea><html></body></textarea>">>),
      ok.
  
  tokens(B, S=#decoder{offset=O}, Acc) ->
  