anchor.diff:      case B of
           <<_:O/binary, "=", _/binary>> ->
               S2 = skip_whitespace(B, ?INC_COL(S1)),
  -            tokenize_word_or_literal(B, S2);
  +            tokenize_quoted_or_unquoted_attr_value(B, S2);
           _ ->
               {Attr, S1}
       end.
  +    
  +tokenize_quoted_or_unquoted_attr_value(B, S=#decoder{offset=O}) ->
  +    case B of
  +        <<_:O/binary>> ->
  +            { [], S };
  +        <<_:O/binary, Q, _/binary>> when Q =:= ?QUOTE orelse
  +                                         Q =:= ?SQUOTE ->
  +            tokenize_quoted_attr_value(B, ?INC_COL(S), [], Q);
  +        <<_:O/binary, _/binary>> ->
  +            tokenize_unquoted_attr_value(B, S, [])
  +    end.
  +    
  +tokenize_quoted_attr_value(B, S=#decoder{offset=O}, Acc, Q) ->
  +    case B of
  +        <<_:O/binary>> ->
  +            { iolist_to_binary(lists:reverse(Acc)), S };
  +        <<_:O/binary, $&, _/binary>> ->
  +            {{data, Data, false}, S1} = tokenize_charref(B, ?INC_COL(S)),
  +            tokenize_quoted_attr_value(B, S1, [Data|Acc], Q);
  +        <<_:O/binary, Q, _/binary>> ->
  +            { iolist_to_binary(lists:reverse(Acc)), ?INC_COL(S) };
  +        <<_:O/binary, $\n, _/binary>> ->
  +            { iolist_to_binary(lists:reverse(Acc)), ?INC_LINE(S) };
  +        <<_:O/binary, C, _/binary>> ->
  +            tokenize_quoted_attr_value(B, ?INC_COL(S), [C|Acc], Q)
  +    end.
  +    
  +tokenize_unquoted_attr_value(B, S=#decoder{offset=O}, Acc) ->
  +    case B of
  +        <<_:O/binary>> ->
  +            { iolist_to_binary(lists:reverse(Acc)), S };
  +        <<_:O/binary, $&, _/binary>> ->
  +            {{data, Data, false}, S1} = tokenize_charref(B, ?INC_COL(S)),
  +            tokenize_unquoted_attr_value(B, S1, [Data|Acc]);
  +        <<_:O/binary, $/, $>, _/binary>> ->
  +            { iolist_to_binary(lists:reverse(Acc)), S };
  +        <<_:O/binary, C, _/binary>> when ?PROBABLE_CLOSE(C) ->
  +            { iolist_to_binary(lists:reverse(Acc)), S };
  +        <<_:O/binary, C, _/binary>> ->
  +            tokenize_unquoted_attr_value(B, ?INC_COL(S), [C|Acc])
  +    end.   
   
   skip_whitespace(B, S=#decoder{offset=O}) ->
       case B of
  
positive.code:     lists:reverse(Acc);
  to_html([{'=', Content} | Rest], Acc) ->
      to_html(Rest, [Content | Acc]);
  to_html([{pi, Tag, Attrs} | Rest], Acc) ->
      Open = [<<"<?">>,
              Tag,
  
negative.code:                         {_, []} ->
                              %% Actually was a singleton
                              Stack;
                          {Pre, [{T1, A1, Acc1} | Post1]} ->
                              [{T0, A0, [{T1, A1, Acc1 ++ lists:reverse(Pre)} | Post1]}
                               | Post0]
                      end;
                  _ ->
  