anchor.diff:  
   %% @spec parse_tokens([html_token()]) -> html_node()
   %% @doc Transform the output of tokens(Doc) into a HTML tree.
  -parse_tokens(Tokens) ->
  +parse_tokens(Tokens) when is_list(Tokens) ->
       %% Skip over doctype
       F = fun (X) ->
                   case X of
  
positive.code:     test_parse_tokens(),
      test_escape(),
      test_escape_attr(),
      ok.
  
  
  %% Internal API
  
  to_html([], Acc) ->
      lists:reverse(Acc);
  to_html([{data, Data, _Whitespace} | Rest], Acc) ->
      to_html(Rest, [escape(Data) | Acc]);
  to_html([{start_tag, Tag, Attrs, Singleton} | Rest], Acc) ->
      Open = "<" ++ Tag ++ attrs_to_html(Attrs, []) ++ case Singleton of
                                                           true -> " />";
                                                           false -> ">"
                                                       end,
      to_html(Rest, [Open | Acc]);
  to_html([{end_tag, Tag} | Rest], Acc) ->
      to_html(Rest, ["</" ++ Tag ++ ">" | Acc]).
  
  attrs_to_html([], Acc) ->
      lists:reverse(Acc);
  attrs_to_html([{K, V} | Rest], Acc) ->
      attrs_to_html(Rest, [" " ++ K ++ "=\"" ++ escape_attr(V) ++ "\"" | Acc]).
      
  test_escape() ->
      "&amp;quot;\"word &lt;&lt;up!&amp;quot;" =
  
negative.code: escape_attr([C | Rest], Acc) ->
      escape_attr(Rest, [C | Acc]).
  
  to_tag(A) when is_atom(A) ->
      atom_to_list(A);
  to_tag(L) ->
      L.
  
  to_tokens([], Acc) ->
      lists:reverse(Acc);
  to_tokens([{Tag, []} | Rest], Acc) ->
      to_tokens(Rest, [{end_tag, to_tag(Tag)} | Acc]);
  to_tokens([{Tag0, [{T0} | R1]} | Rest], Acc) ->
      %% Allow {br}
      to_tokens([{Tag0, [{T0, [], []} | R1]} | Rest], Acc);
  to_tokens([{Tag0, [{T0, C0} | R1]} | Rest], Acc) ->
      %% Allow {p, ["content"]}
      to_tokens([{Tag0, [{T0, [], C0} | R1]} | Rest], Acc);
  to_tokens([{Tag0, [{T0, A1, C0} | R1]} | Rest], Acc) when is_binary(C0) ->
      %% Allow {"p", [{"class", "foo"}], <<"content">>}
      to_tokens([{Tag0, [{T0, A1, binary_to_list(C0)} | R1]} | Rest], Acc);
  to_tokens([{Tag0, [{T0, A1, C0=[C | _]} | R1]} | Rest], Acc)
    when is_integer(C) ->
      %% Allow {"p", [{"class", "foo"}], "content"}
      to_tokens([{Tag0, [{T0, A1, [C0]} | R1]} | Rest], Acc);
  to_tokens([{Tag0, [{T0, A1, C1} | R1]} | Rest], Acc) ->
      %% Native {"p", [{"class", "foo"}], ["content"]}
      Tag = to_tag(Tag0),
      T1 = to_tag(T0),
      case is_singleton(T1) of
          true ->
              to_tokens([{Tag, R1} | Rest], [{start_tag, T1, A1, true} | Acc]);
  