Glass Mapper RenderLink 双引号

Glass Mapper RenderLink double quotation marks

我在 Sitecore 8 中使用 Glass Mapper。Glass Mapper 使用单引号呈现 links,当 link 文本本身有引号时会出错:

<a href='' class=' ' title='Coroner's Request' >

如何让 Glass Mapper 在 link 中使用双引号? 我注意到该选项已添加到 a recent change, which has included a new property in the GlassHtml class 中。但我似乎无法在任何地方找到如何配置它!我错过了什么?

感谢您的回答。

这是GlassHtmlclass的字段。您需要设置它,例如通过执行此代码:

Glass.Mapper.Sc.GlassHtml.QuotationMark = "\"";

这是一个静态字段,因此只需执行一次即可,例如在 <initialize> 管道中。