anchor.diff:  %% Internal API
   
   test_to_html() ->
  -    Expect = <<"<html><head><title>hey!</title></head><body><p class=\"foo\">what's up<br /></p><div>sucka</div></body></html>">>,
  +    Expect = <<"<html><head><title>hey!</title></head><body><p class=\"foo\">what's up<br /></p><div>sucka</div><!-- comment! --></body></html>">>,
       Expect = iolist_to_binary(
                  to_html({html, [],
  -                        [{"head",
  +                        [{"head", [],
                             [{title, "hey!"}]},
                            {body, [],
                             [{p, [{class, foo}], ["what's", <<" up">>, {br}]},
  -                           {'div', <<"sucka">>}]}]})),
  +                           {'div', <<"sucka">>},
  +                           {comment, " comment! "}]}]})),
  +    Expect1 = <<"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">">>,
  +    Expect1 = iolist_to_binary(
  +                to_html({doctype,
  +                         ["html", "PUBLIC",
  +                          "-//W3C//DTD XHTML 1.0 Transitional//EN",
  +                          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"]})),
       ok.
   to_html([], Acc) ->
       lists:reverse(Acc);
  +to_html([{'=', Content} | Rest], Acc) ->
  +    to_html(Rest, [Content | Acc]);
  +to_html([{comment, Comment} | Rest], Acc) ->
  +    to_html(Rest, [["<!--" ++ Comment, "-->"] | Acc]);
  +to_html([{doctype, Parts} | Rest], Acc) ->
  +    Inside = doctype_to_html(Parts, Acc),
  +    to_html(Rest, [["<!DOCTYPE" ++ Inside, ">"] | Acc]);
   to_html([{data, Data, _Whitespace} | Rest], Acc) ->
       to_html(Rest, [escape(Data) | Acc]);
   to_html([{start_tag, Tag, Attrs, Singleton} | Rest], Acc) ->
  
positive.code:         end).
  
  -define(IS_WHITESPACE(C),
  	(C =:= $\s orelse C =:= $\t orelse C =:= $\r orelse C =:= $\n)).
                                  
  -record(decoder, {line=1,
  		  column=1}).
  
  %% @type html_node() = {string(), [html_attr()], [html_node() | string()]}
  %% @type html_attr() = {string(), string()}
  %% @type html_token() = html_data() | start_tag() | end_tag()
  %% @type html_data() = {data, string(), Whitespace::boolean()}
  %% @type start_tag() = {start_tag, Name, [html_attr()], Singleton::boolean()}
  %% @type end_tag() = {end_tag, Name}
  
  %% External API.
  
  
negative.code: 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 {'=', iolist()}
      to_tokens([{Tag0, R1} | Rest], [T0 | Acc]);
  to_tokens([{Tag0, [T0={comment, _C0} | R1]} | Rest], Acc) ->
      %% Allow {comment, iolist()}
      to_tokens([{Tag0, R1} | Rest], [T0 | Acc]);
  to_tokens([{Tag0, [{T0, A0=[{_, _} | _]} | R1]} | Rest], Acc) ->
      %% Allow {p, [{"class", "foo"}]}
      to_tokens([{Tag0, [{T0, A0, []} | R1]} | Rest], Acc);
  to_tokens([{Tag0, [{T0, C0} | R1]} | Rest], Acc) ->
      %% Allow {p, "content"} and {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">>}
  