简体   繁体   English

Smart.Format 版本 2.5.0 升级后出现错误

[英]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.

相关问题 ServiceStack FallbackRoute升级ServiceStack版本失败 - ServiceStack FallbackRoute failing with upgraded ServiceStack version 我将我的项目升级到 .NET Framework 4.8 和新的包格式,现在我收到一条错误消息,提示 System.Net.Http 丢失 - I upgraded my project to .NET Framework 4.8 and the new package format, and now I get an error saying System.Net.Http is missing 按发布日期和版本进行智能排序 - Smart sorting by release date and version 升级的dotLess错误:IImporter不包含“路径”的定义 - Upgraded dotLess error: IImporter does not contain definition for 'Paths' 更改发布版本格式 - To change publish version format 如何将Umbraco CMS从使用SQL Server CE升级到SQL Server的升级版本? - How do I upgrade Umbraco CMS from using SQL Server CE to an upgraded version of SQL Server? 以xml格式从嵌入式设备输出数据是否明智? - Is it smart to output data from embedded device in xml format? 无法安装自定义,因为当前安装了另一个版本并且无法从该位置升级 - The customization cannot be installed because another version is currently installed and cannot be upgraded from this location 升级到.NET 4.0并获取无法加载已删除的旧版DLL的文件或程序集引用 - Upgraded to .NET 4.0 & getting Could not load file or assembly reference to old version of DLL that was removed “无法安装自定义,因为当前安装了另一个版本,无法从该位置升级” - “The customization cannot be installed because another version is currently installed and cannot be upgraded from this location”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM