From c5a51539c202bbe19397b9c3eb14b1c25f421b6a Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sat, 26 Mar 2016 06:36:13 +0100 Subject: [PATCH] add support for new dcd ddoc escape system --- src/ce_dcd.pas | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/ce_dcd.pas b/src/ce_dcd.pas index 590973fe..1dbb54d7 100644 --- a/src/ce_dcd.pas +++ b/src/ce_dcd.pas @@ -9,7 +9,8 @@ uses {$IFDEF WINDOWS} windows, {$ENDIF} - ce_common, ce_writableComponent, ce_interfaces, ce_observer, ce_synmemo; + ce_common, ce_writableComponent, ce_interfaces, ce_observer, ce_synmemo, + ce_stringrange; type @@ -481,7 +482,22 @@ begin if fTempLines.Count = 0 then updateServerlistening; for str in fTempLines do - aComment += ReplaceStr(str, '\n', LineEnding); + begin + with TStringRange.create(str) do while not empty do + begin + aComment += takeUntil('\').yield; + if startsWith('\\') then + begin + aComment += '\'; + popFront; popFront; + end + else if startsWith('\n') then + begin + aComment += LineEnding; + popFront; popFront; + end + end; + end; // aComment := ReplaceText(aComment, 'ditto' + LineEnding + LineEnding, ''); aComment := ReplaceText(aComment, 'ditto', '');