anchor.diff:          Bin ->
               {[Bin|T],true}
       end;
  -trim_first([{Elem,Attr,Content} = Tag|T],false,What) ->
  -    case trim_first(Content,false,What) of
  +trim_first([{Elem,Attr,Content} = Tag|T],What) ->
  +    case trim_first(Content,What) of
           {[],true} ->
               {T,true};
           {NewContent,true} ->
               {[{Elem,Attr,NewContent}|T],true};
           {Content,false} ->
  -            {NewT,NewState} = trim_first(T,false,What),
  +            {NewT,NewState} = trim_first(T,What),
               {[Tag | NewT],NewState}
       end;
  -trim_first([],false,_What) ->
  +trim_first([],_What) ->
       {[],false}.
   
   trim_last([Bin | T],What) when is_binary(Bin) ->
  
positive.code: %% 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) ->
      case Bin of
          <<What>> ->
              {T,true};
  
negative.code: trim_inline([{Elem,Attr,Content}|T],TrimSpace) ->
      {NewContent,ContentTrimSpace} = trim_inline(Content,TrimSpace),
      {NewT,TTrimSpace} = trim_inline(T,ContentTrimSpace),
      IsAnchor = (Elem =:= a) andalso proplists:is_defined(id,Attr),
      if NewContent == [] andalso (not IsAnchor) ->
              %% Remove if all content has been trimmed and this is not an anchor
              {NewT, TTrimSpace};
         true ->
              {[{Elem,Attr,NewContent} | NewT], TTrimSpace}
  