anchor.diff:          unescape(T, <<Acc/binary, "€">>);
       unescape(<<C, T/binary>>, Acc) ->
           unescape(T, <<Acc/binary, C>>).
  +
  +
  +%% @doc Escape a text. Expands any urls to links with a nofollow attribute.
  +%% @spec escape_link(Text) -> binary()
  +escape_link(undefined) ->
  +    undefined;
  +escape_link(<<>>) ->
  +    <<>>;
  +escape_link([]) ->
  +    <<>>;
  +escape_link(Text) ->
  +    case re:run(Text, "\\b(([\\w-]+://?|www[.])[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/)))", [{capture, first, index}, global]) of
  +        {match, Matches} ->
  +            Matches1 = [ hd(M) || M <- Matches ],
  +            nl2br(iolist_to_binary(make_links1(0, Matches1, z_convert:to_list(Text), [])));
  +        nomatch ->
  +            nl2br(escape(Text))
  +    end.
  +
  +    make_links1(_Offset, [], Text, Acc) ->
  +        lists:reverse([escape(Text) | Acc]);
  +    make_links1(Offset, [{Offset, Len}|Rest], Text, Acc) ->
  +        {Link, Text1} = lists:split(Len, Text),
  +        Link1 = escape(noscript(Link)),
  +        make_links1(Offset+Len, Rest, Text1, [["<a href=\"",Link1,"\" rel=\"nofollow\">",Link1,"</a>"] | Acc]);
  +    make_links1(Offset, [{MatchOffs,_}|_] = Matches, Text, Acc) ->
  +        {Text1,Text2} = lists:split(MatchOffs-Offset, Text),
  +        make_links1(MatchOffs, Matches, Text2, [escape(Text1)|Acc]).
   
   
   %% @doc Strip all html elements from the text. Simple parsing is applied to find the elements. Does not escape the end result.
  
positive.code: 
  
  %% @doc Escape a string so that it is valid within HTML/ XML.
  %% @spec escape(iolist()) -> iolist()
  escape(undefined) -> 
      undefined;
  escape(<<>>) -> 
      <<>>;
  escape([]) ->
      [];
  escape(L) when is_list(L) ->
      escape(list_to_binary(L));
  escape(B) when is_binary(B) ->
  
negative.code:     unescape/1,
      strip/1,
  	sanitize/1,
  	noscript/1,
      escape_link/1,
      nl2br/1
  ]).
  
  -include_lib("zotonic.hrl").
  