anchor.diff:  %% This is complicated by the fact that the first or last element
   %% may not have any binary, or have the binary deeply nested within.
   trim_first_and_last(Content, What) when What < 256 ->
  -    {NewContent,_State} = trim_last(trim_first(Content,What),What),
  -    NewContent.
  -
  -trim_first(Content,What) ->
  -    {NewContent,_State} = trim_first(Content,false,What),
  -    NewContent.
  -trim_first([Bin|T],false,What) when is_binary(Bin) ->
  +    {FirstTrimmed, _} = trim_first(Content,What),
  +    {LastTrimmed, _} = trim_last(FirstTrimmed,What),
  +    LastTrimmed.
  +
  +trim_first([Bin|T],What) when is_binary(Bin) ->
       case Bin of
           <<What>> ->
               {T,true};
  
positive.code: trim_inline([{Elem,Attr,Content}|T],TrimSpace) ->
      {NewContent,ContentTrimSpace} = trim_inline(Content,TrimSpace),
      {NewT,TTrimSpace} = trim_inline(T,ContentTrimSpace),
      if NewContent == [] ->
              {NewT, TTrimSpace};
         true ->
              {[{Elem,Attr,NewContent} | NewT], TTrimSpace}
  
negative.code:             {[Tag | NewT],true};
          {T,false} ->
              case trim_last(Content,What) of
                  {[],true} ->
                      %% If the content became empty and we processed some text
                      %% we remove the element.
                      {[],true};
                  {NewContent,NewState} ->
                      {[{Elem,Attr,NewContent}|T],NewState}
              end
      end;
  trim_last([],_What) ->
      {[],false}.
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %% API function for dealing with the function documentation
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  