anchor.diff:         mochiweb_html:parse(D0)),
       ok.
   
  +parse_amps_attr_test() ->
  +    D0 = <<"<a href=\"/hello?test=1&amp;that=2\"></a>">>,
  +    ?assertEqual(
  +       {<<"a">>, [ { <<"href">>, <<"/hello?test=1&that=2">> }], [] },
  +       mochiweb_html:parse(D0)),
  +    
  +    D1 = <<"<a href=\"/hello?test=1&that=2\"></a>">>,
  +    ?assertEqual(
  +       {<<"a">>, [ { <<"href">>, <<"/hello?test=1&that=2">> }], [] },
  +       mochiweb_html:parse(D1)),
  +
  +    D2 = <<"<a href=\"/hello?test=123&that=2&amp;this=too\"></a>">>,
  +    ?assertEqual(
  +       {<<"a">>, [ { <<"href">>, <<"/hello?test=123&that=2&this=too">> }], [] },
  +       mochiweb_html:parse(D2)),
  +
  +    D3 = <<"<a href=\"/product/54?c=hk-machine&id=1008&shop=auto-oko-74-H\"></a>">>,
  +    ?assertEqual(
  +       {<<"a">>, [ { <<"href">>, <<"/product/54?c=hk-machine&id=1008&shop=auto-oko-74-H">> }], [] },
  +       mochiweb_html:parse(D3)),
  +
  +    D4 = <<"<a href=\"test?a=1&amp=1008\"></a>">>,
  +    ?assertEqual(
  +       {<<"a">>, [ { <<"href">>, <<"test?a=1&amp=1008">> }], [] },
  +       mochiweb_html:parse(D4)),
  +    
  +    ok.
  +
   parse_broken_pi_test() ->
   	D0 = <<"<html><?xml:namespace prefix = o ns = \"urn:schemas-microsoft-com:office:office\" /></html>">>,
   	?assertEqual(
  
positive.code:                 true -> <<" />">>;
                  false -> <<">">>
              end],
      to_html(Rest, [Open | Acc]);
  to_html([{end_tag, Tag} | Rest], Acc) ->
      to_html(Rest, [[<<"</">>, Tag, <<">">>] | Acc]).
  
  doctype_to_html([], Acc) ->
      lists:reverse(Acc);
  
negative.code:     case Bin of
          <<_:O/binary>> ->
              <<_:Start/binary, Raw/binary>> = Bin,
  	    io:fwrite(standard_error, "& gelezen?: ~p", [Raw]),
              {{data, Raw, false}, S};
          <<_:O/binary, C, _/binary>> when ?IS_WHITESPACE(C)
                                           orelse C =:= ?SQUOTE
                                           orelse C =:= ?QUOTE
                                           orelse C =:= $/
                                           orelse C =:= $> 
                                           orelse C =:= $& ->
              Len = O - Start,
              <<_:Start/binary, Raw:Len/binary, _/binary>> = Bin,
  	    Data = case mochiweb_charref:charref(Raw) of
                         undefined ->
                             Start1 = Start - 1,
                             Len1 = Len + 1,
                             <<_:Start1/binary, R:Len1/binary, _/binary>> = Bin,
                             R;
                         Unichar ->
                             mochiutf8:codepoint_to_bytes(Unichar)
                     end,
              {{data, Data, false}, S};
          <<_:O/binary, $;, _/binary>> ->
              Len = O - Start,
              <<_:Start/binary, Raw:Len/binary, _/binary>> = Bin,
  