anchor.diff:    Vcl.Themes,
   {$endif}
     Math, Clipbrd, Forms, Printers,
  -{$ifdef UNICODE}
  -  AnsiStrings,
  -{$endif}
   {$ifndef NoGDIPlus}
     GDIPL2A,
   {$endif}
  
positive.code:       // about clipboard format: http://msdn.microsoft.com/en-us/library/aa767917%28v=vs.85%29.aspx
        StartFrag: ThtString = '<!--StartFragment-->';
        EndFrag: ThtString = '<!--EndFragment-->';
        DocType: ThtString = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'#13#10;
  
      function GetHeader(const HTML: ThtString): ThtString;
      const
        Version = 'Version:1.0'#13#10;
        StartHTML = 'StartHTML:';
        EndHTML = 'EndHTML:';
        StartFragment = 'StartFragment:';
        EndFragment = 'EndFragment:';
        SourceURL = 'SourceURL:';
        NumberLengthAndCR = 10;
  
        // Let the compiler determine the description length.
        PreliminaryLength = Length(Version) + Length(StartHTML) +
          Length(EndHTML) + Length(StartFragment) +
          Length(EndFragment) + 4 * NumberLengthAndCR +
          2; {2 for last CRLF}
      var
        URLString: ThtString;
        StartHTMLIndex,
          EndHTMLIndex,
          StartFragmentIndex,
          EndFragmentIndex: Integer;
      begin
        if CurrentFile = '' then
          UrlString := SourceURL + 'unsaved:///THtmlViewer.htm'
        else if Pos('://', CurrentFile) > 0 then
          URLString := SourceURL + CurrentFile {already has protocol}
        else
          URLString := SourceURL + 'file://' + CurrentFile;
        StartHTMLIndex := PreliminaryLength + Length(URLString);
        EndHTMLIndex := StartHTMLIndex + Length(HTML);
        StartFragmentIndex := StartHTMLIndex + Pos(StartFrag, HTML) + Length(StartFrag) - 1;
        EndFragmentIndex := StartHTMLIndex + Pos(EndFrag, HTML) - 1;
  
        Result := Version +
          SysUtils.Format('%s%.8d', [StartHTML, StartHTMLIndex]) + #13#10 +
          SysUtils.Format('%s%.8d', [EndHTML, EndHTMLIndex]) + #13#10 +
          SysUtils.Format('%s%.8d', [StartFragment, StartFragmentIndex]) + #13#10 +
          SysUtils.Format('%s%.8d', [EndFragment, EndFragmentIndex]) + #13#10 +
          URLString + #13#10;
      end;
  
      procedure RemoveTag(const Tag: ThtString);
  
negative.code:       Result := Copy(HTML, 1, I); {truncate the tags}
      end;
  
    const
      DocType: ThtString = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'#13#10;
    var
      Utf8String: AnsiString;
    begin
    {Truncate beyond EnSrc}
      HTML := Copy(HTML, 1, EnSrc - 1);
  