anchor.diff:  
   scan_token([], Acc, L) ->
       {lists:reverse(Acc), [], L};
  -scan_token(R=[$>|_], Acc, L) ->
  -    {lists:reverse(Acc), R, L};
  -scan_token(R=[$<|_], Acc, L) ->  %%% bad html
  -    {lists:reverse(Acc), R, L};
  -scan_token(R=[$=|_], Acc, L) ->  %% bad html
  -    {lists:reverse(Acc), R, L};
  -scan_token([C|R], Acc, L0) ->
  -    case char_class(C) of
  -        space ->
  -            {lists:reverse(Acc), R, L0};
  -        nl ->
  -            {lists:reverse(Acc), R, L0+1};
  -        _ ->
  -            scan_token(R, [C|Acc], L0)
  -    end.
  +scan_token([$\r,$\n|R], Acc, L) ->
  +    {lists:reverse(Acc), R, L+1};
  +scan_token([C|R], Acc, L) when C=:=$\n; C=:=$\r ->
  +    {lists:reverse(Acc), R, L+1};
  +scan_token([C|R], Acc, L) when C=:=$\s; C=:=$\t ->
  +    {lists:reverse(Acc), R, L};
  +scan_token(R=[C|_], Acc, L) when C=:=$>; C=:=$<; C=:=$= ->
  +    {lists:reverse(Acc), R, L};
  +scan_token([C|R], Acc, L) ->
  +    scan_token(R, [C|Acc], L).
   
   %%
   
  
positive.code: 
  scan_endtag([], _Tag, Acc, L) ->
      {lists:reverse(Acc), [], L};
  scan_endtag(R=[$<,$/|R0], Tag, Acc, L0) ->
      case casecmp(Tag, R0) of
          {true, R1} ->
  
negative.code:         false ->
              scan_endtag(R0, Tag, Acc, L0)
      end;
  scan_endtag([C|R], Tag, Acc, L) ->
      scan_endtag(R, Tag, [C|Acc], L).
  
  %%
  
  casecmp([], R) ->
      {true, R};
  casecmp([C|T1], [C|T2]) ->
      casecmp(T1, T2);
  casecmp([C1|T1], [C2|T2]) when C1>=$a, C1=<$z, C1=:=(C2-$A+$a) ->
      casecmp(T1, T2);
  casecmp([C1|T1], [C2|T2]) when C2>=$a, C2=<$z, C2=:=(C1-$A+$a) ->
      casecmp(T1, T2);
  casecmp(_L1, _L2) ->
      false.
  
  %%
  
  skip_space([$\r,$\n|R], L) ->
      skip_space(R, L+1);
  skip_space([C|R], L) when C=:=$\n; C=:=$\r ->
      skip_space(R, L+1);
  skip_space([C|R], L) when C=:=$\s; C=:=$\t ->
      skip_space(R, L);
  skip_space(R, L) ->
      {R, L}.
  
  %%
  
  skip_comment([], L) ->
      {[], L};
  skip_comment([$-, $-, $>|R], L) ->
      {R, L};
  skip_comment([$\r,$\n|R], L) ->
      skip_comment(R, L+1);
  skip_comment([C|R], L) when C=:=$\n; C=:=$\r ->
      skip_comment(R, L+1);
  skip_comment([_C|R], L) ->
      skip_comment(R, L).
  
  %%
  
  