我使用DotLiquid来渲染我的电子邮件模板。
我在下一个方面使用它:
var subjectTemplate = Template.Parse(subjectTemplateSource);
var hash = Hash.FromAnonymousObject(parameters);
var subject = subjectTemplate.Render(hash);
如果subjectTemplateSource
包含{{ParamName}
之类的无效标记(没有第二个结束曲线括号),那么Template.Parse
将SyntaxException
引发消息Variable '{{ParamName}' was not properly terminated with regexp: (?-mix:\}\})
。
我想知道是否有可能将DotLiquid
配置为忽略无效标记(只是保留原样)?
还有任何验证工具在解析之前检查source
吗?