add support for new dcd ddoc escape system

This commit is contained in:
Basile Burg 2016-03-26 06:36:13 +01:00
parent 0f90db2caf
commit c5a51539c2
1 changed files with 18 additions and 2 deletions

View File

@ -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', '');