anchor.diff:  test() ->
       test_destack(),
       test_tokens(),
  +    test_tokens2(),
       test_parse(),
  +    test_parse2(),
       test_parse_tokens(),
       test_escape(),
       test_escape_attr(),
  
positive.code:                 [{<<"id">>,<<"home">>},
                   {<<"class">>,<<"tundra">>}],
                  [<<"&lt;<this<!-- is -->CDATA>&gt;">>]}]},
      Expect = parse(D0),
      ok.
  
  
negative.code:         end,
      case lists:splitwith(F, Stack) of
          {_, []} ->
              %% If we're parsing something like XML we might find
              %% a <link>tag</link> that is normally a singleton
              %% in HTML but isn't here
              case {is_singleton(TagName), Stack} of
                  {true, [{T0, A0, Acc0} | Post0]} ->
                      case lists:splitwith(F, Acc0) of
                          {_, []} ->
                              %% Actually was a singleton
                              Stack;
                          {Pre, [{T1, A1, []} | Post1]} ->
                              [{T0, A0, [{T1, A1, lists:reverse(Pre)} | Post1]}
                               | Post0]
                      end;
                  _ ->
                      %% No match, no state change
                      Stack
              end;
          {_Pre, [_T]} ->
              %% Unfurl the whole stack, we're done
              destack(Stack);
  