anchor.diff:  
   exhaustive_is_singleton_test() ->
       T = z_cover:clause_lookup_table(?MODULE, is_singleton),
  -    [?assertEqual(V, is_singleton(K)) || {K, V} <- T].
  +    [?assertEqual(V, is_singleton(K, #{ mode => html })) || {K, V} <- T].
   
   tokenize_attributes_test() ->
       ?assertEqual(
  
positive.code: 
      ok.
  
  -endif.
  
negative.code:         end,
      case lists:dropwhile(F, Tokens) of
          [{start_tag, Tag, Attrs, false} | Rest] ->
              {Tree, _} = tree(Rest, [ norm({Tag, Attrs}, Options) ], Options),
              {ok, Tree};
          [{start_tag, Tag, Attrs, true} ] when Mode =:= xml ->
              {Tree, _} = tree([], [ norm({Tag, Attrs}, Options) ], Options),
              {ok, Tree};
          [] ->
              {error, nohtml}
      end.
  
  %% @doc Transform the input UTF-8 HTML into a token stream.
  -spec tokens( iodata() ) -> [ html_token() ].
  tokens(Input) ->
      tokens(Input, #{ mode => html, escape => true }).
  
  -spec tokens( iodata(), options() ) -> [ html_token() ].
  tokens(Input, Options) ->
      tokens(iolist_to_binary(Input), #decoder{}, [], Options).
  
  %% @doc Convert a html_node() tree to a list of tokens.
  -spec to_tokens( html_tree() ) -> [ html_token() ].
  to_tokens(HtmlNode) ->
      to_tokens(HtmlNode, #{ mode => html, escape => true }).
  
  -spec to_tokens( html_tree(), options() ) -> [ html_token() ].
  to_tokens({Tag0}, Options) ->
      to_tokens({Tag0, [], []}, Options);
  to_tokens(T={'=', _}, _Options) ->
      [T];
  to_tokens(T={doctype, _}, _Options) ->
      [T];
  to_tokens(T={comment, _}, _Options) ->
      [T];
  to_tokens({Tag0, Acc}, Options) ->
      %% This is only allowed in sub-tags: {p, [{"class", "foo"}]}
      to_tokens({Tag0, [], Acc}, Options);
  to_tokens({Tag0, Attrs, []}, #{ mode := xml } = Options) ->
      Tag = to_tag(Tag0, Options),
      to_tokens_1([], [{start_tag, Tag, Attrs, true}], Options);
  to_tokens({Tag0, Attrs, Acc}, Options) ->
      Tag = to_tag(Tag0, Options),
      case is_singleton(Tag, Options) of
          true ->
              to_tokens_1([], [{start_tag, Tag, Attrs, true}], Options);
          false ->
              to_tokens_1([{Tag, Acc}], [{start_tag, Tag, Attrs, false}], Options)
      end.
  
  %% @doc Convert a list of html_token() to a HTML document.
  -spec to_html([ html_token() ] | html_tree() ) -> iodata().
  to_html(Node) ->
      to_html(Node, #{ mode => html, escape => true }).
  
  -spec to_html([ html_token() ] | html_tree(), options() ) -> iodata().
  to_html(Node, Options) when is_tuple(Node) ->
      Options1 = opts(Options),
      to_html(to_tokens(Node, Options1), Options1);
  to_html(Tokens, Options) when is_list(Tokens) ->
      Options1 = opts(Options),
      to_html_1(Tokens, [], Options1).
  
  %% @spec escape(string() | atom() | binary()) -> binary()
  %% @doc Escape a string such that it's safe for HTML (amp; lt; gt;).
  