sempare / sempare-delphi-template-engine

Sempare Template (scripting) Engine for Delphi allows for flexible dynamic text generation. It can be used for generating email, html, reports, source code, xml, configuration, etc.
Apache License 2.0
144 stars 18 forks source link

[Feature] Support double quotes in the expressions #19

Closed edwinyzh closed 4 years ago

edwinyzh commented 4 years ago

Not must-have, but nice to have, because it makes the code better to read when constructing the template scripts in Delphi code:

procedure TTestTemplateExpr.TestTernary;
begin
  Assert.AreEqual('a', Template.Eval('<% true?''a'':''b'' %>'));
  Assert.AreEqual('b', Template.Eval('<% false?''a'':''b'' %>'));

  // It'll be nice-to have if the above statements can be written as the following form:
  Assert.AreEqual('a', Template.Eval('<% true?"a":"b" %>'));
  Assert.AreEqual('b', Template.Eval('<% false?"a":"b" %>'));
end;
edwinyzh commented 4 years ago

Great! Thanks for the improvement!