anchor.diff:          end).
   
   -define(IS_WHITESPACE(C),
  -	(C =:= $\s orelse C =:= $\t orelse C =:= $\r orelse C =:= $\n)).
  + 	(C =:= $\s orelse C =:= $\t orelse C =:= $\r orelse C =:= $\n)).
  +-define(IS_LITERAL_SAFE(C),
  +        ((C >= $A andalso C =< $Z) orelse (C >= $a andalso C =< $z)
  +         orelse (C >= $0 andalso C =< $9))).
                                   
   -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_token() = html_data() | start_tag() | end_tag() | inline_html() | html_comment() | html_doctype()
   %% @type html_data() = {data, string(), Whitespace::boolean()}
   %% @type start_tag() = {start_tag, Name, [html_attr()], Singleton::boolean()}
   %% @type end_tag() = {end_tag, Name}
  +%% @type html_comment() = {comment, Comment}
  +%% @type html_doctype() = {doctype, [Doctype]}
  +%% @type inline_html() = {'=', iolist()}
   
   %% External API.
   
  
positive.code: 
  %% @spec to_tokens(html_node()) -> [html_token()]
  %% @doc Convert a html_node() tree to a list of tokens.
  to_tokens({Tag0, Attrs, Acc}) ->
      Tag = to_tag(Tag0),
      to_tokens([{Tag, Acc}], [{start_tag, Tag, Attrs, is_singleton(Tag)}]).
  
  %% @spec to_html([html_token()] | html_node()) -> iolist()
  %% @doc Convert a list of html_token() to a HTML document.
  to_html(Node={_Tag, _Attrs, _Acc}) ->
      to_html(to_tokens(Node));
  to_html(Tokens) when is_list(Tokens) ->
      to_html(Tokens, []).
  
negative.code: to_html([{end_tag, Tag} | Rest], Acc) ->
      to_html(Rest, [["</" ++ Tag, ">"] | Acc]).
  
  doctype_to_html([], Acc) ->
      lists:reverse(Acc);
  doctype_to_html([Word | Rest], Acc) ->
      case lists:all(fun (C) -> ?IS_LITERAL_SAFE(C) end, Word) of
          true ->
              doctype_to_html(Rest, [" " ++ Word | Acc]);
          false ->
              doctype_to_html(Rest, [[" \"" ++ escape_attr(Word), ?QUOTE] | Acc])
      end.
  
  attrs_to_html([], Acc) ->
      lists:reverse(Acc);
  attrs_to_html([{K, V} | Rest], Acc) ->
  