anchor.diff:    ATSynEdit_Finder,
     ATSynEdit_Cmp_HTML,
     ATSynEdit_RegExpr,
  +  ATSynEdit_FGL,
     ATStrings,
     ATStringProc,
     ATStringProc_Separator,
  
positive.code: unit proc_editor;
  
  {$mode objfpc}{$H+}
  
  interface
  
  
negative.code:       if not AllowSingletonTags then
          if not IsTagNeedsClosingTag(sTag) then Continue;
  
        TagRecord.bClosing:= bClosing;
        TagRecord.sTagName:= sTag;
        AList.Add(TagRecord);
      until not obj.ExecNext;
    finally
      obj.Free;
    end;
  end;
  
  function EditorFindHtmlLastOpenedTagInText(const AText: UnicodeString): string;
  var
    tags: TEditorHtmlTagList;
    i, j: integer;
  begin
    Result:= '';
    tags:= TEditorHtmlTagList.Create;
    try
      EditorFindHtmlTagsInText(AText, tags, false);
  
      //delete pairs <tag> - </tag>
      for i:= tags.Count-1 downto 0 do
      begin
        if not tags[i].bClosing then
          for j:= i+1 to tags.Count-1 do
            if tags[j].bClosing and SameText(tags[i].sTagName, tags[j].sTagName) then
            begin
              tags.Delete(j);
              tags.Delete(i);
              Break;
            end;
      end;
  
      //take last opened tag
      for i:= tags.Count-1 downto 0 do
        if not tags[i].bClosing then
          exit(tags[i].sTagName);
    finally
      FreeAndNil(tags);
    end;
  end;
  
  
  