[英]Smart.Format version 2.5.0 error once upgraded
I just upgraded from smart.format 2.4.2 to 2.5.0.我刚刚从 smart.format 2.4.2 升级到 2.5.0。 I have the following in production since 2018:自 2018 年以来,我在生产中有以下产品:
attFilePath = "C:/dev/template.html" //HTML TEMPLATE WITH PLACEHOLDERS IN IT LIKE, Welcome {FirstName})
Smart.Default.Parser.UseAlternativeEscapeChar('\\');
var myTemplate = File.ReadAllText(attFilePath);
request.AddParameter(emailMessage.MessageIsBodyHtml ? "html" : "text", Smart.Format(File.ReadAllText(attFilePath), passengerTemplateValues));
The last instruction reads the html as a string and apply smart.format to change the placeholders with the actual data.最后一条指令将 html 读取为字符串并应用 smart.format 以使用实际数据更改占位符。 Everything worked fine until I decide to upgrade to 2.5.一切正常,直到我决定升级到 2.5。 The error that I'm getting is "There are 56 issues, Invalid character in the selector".我得到的错误是“有 56 个问题,选择器中的字符无效”。 What Actually change that it cannot parse the html with the placeholders anymore?它不能再用占位符解析 html 的实际改变是什么? I change to 2.4.2 and everything is working now again.我更改为 2.4.2,现在一切正常。
While processing pure HTML works absolutely fine, the result becomes unpredictable with CSS and/or JavaScript.虽然处理纯 HTML 工作得很好,但使用 CSS 和/或 JavaScript 结果变得不可预测。 The reason is: Smart.Format uses braces to identify Placeholders, which are at the same time part of the CSS/JavaScript notation.原因是:Smart.Format 使用大括号来标识Placeholders,Placeholders 同时也是CSS/JavaScript notation 的一部分。 There is a solution published in the Smart.Format Wiki Smart.Format Wiki中发布了一个解决方案
Change Log breaking changes help with the problem!更改日志中断更改有助于解决问题! Must read first!必须先阅读!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.