diff --git a/tomboy-ng/loadnote.pas b/tomboy-ng/loadnote.pas index 728b447b..44206e61 100644 --- a/tomboy-ng/loadnote.pas +++ b/tomboy-ng/loadnote.pas @@ -38,6 +38,7 @@ 20171007 - enabled bullets. 20171112 - added code to restore < and > + 2018/01/31 - and & } {$mode objfpc}{$H+} @@ -178,6 +179,12 @@ function TBLoadNote.ReplaceAngles(const Str : AnsiString) : AnsiString; Start := Index + 3; Continue; end; + if '&' = UTF8Copy(Str, Index, 5) then begin + Result := Result + UTF8Copy(Str, Start, Index - Start) + '&'; + inc(Index); + Start := Index + 4; + Continue; + end; inc(Index); end; Result := Result + UTF8Copy(Str, Start, Index - Start); diff --git a/tomboy-ng/savenote.pas b/tomboy-ng/savenote.pas index c6b105dc..f3db08af 100644 --- a/tomboy-ng/savenote.pas +++ b/tomboy-ng/savenote.pas @@ -48,6 +48,7 @@ previous queued format changes. Possibly. This is not robust code. 2018/01/01 Yet another bug fix for BulletList(), this time I've got it ! 2018/01/25 Changes to support Notebooks + 2018/01/31 Added code to reprocess & } {$mode objfpc}{$H+} @@ -250,6 +251,7 @@ procedure TBSaveNote.BulletList(var Buff : ANSIString); end; function TBSaveNote.RemoveBadCharacters(const InStr : ANSIString) : ANSIString; +// It appears that Tomboy only processes <, > and & var //Res : ANSIString; Index : longint = 1; @@ -271,6 +273,14 @@ function TBSaveNote.RemoveBadCharacters(const InStr : ANSIString) : ANSIString; Start := Index; continue; end; + if InStr[Index] = '&' then begin + Result := Result + UTF8Copy(InStr, Start, Index - Start); + Result := Result + '&'; + inc(Index); + Start := Index; + continue; + end; + inc(Index); end; Result := Result + UTF8Copy(InStr, Start, Index - Start);