我有这个使用PreMailer内联CSS的代码;
PreMailer.Net.PreMailer cleanser = new PreMailer.Net.PreMailer(htmlString);
PreMailer.Net.InlineResult result = cleanser.MoveCssInline(ignoreElements: ".ignore");
return result.Html
但我得到了这个例外:
找不到方法:'Void AngleSharp.Dom.IElement.RemoveAttribute(System.String)'
堆栈跟踪
[MissingMethodException: Method not found: 'Void AngleSharp.Dom.IElement.RemoveAttribute(System.String)'.]
PreMailer.Net.StyleClassApplier.ApplyStyles(IElement domElement, StyleClass clazz) +0
PreMailer.Net.StyleClassApplier.ApplyAllStyles(Dictionary`2 elementDictionary) +125
PreMailer.Net.PreMailer.MoveCssInline(Boolean removeStyleElements, String ignoreElements, String css, Boolean stripIdAndClassAttributes, Boolean removeComments) +241
答案可能很明显,但我只是没有点击。
AngleSharp:v0.9.9
PreMailer:v1.5.4
答案 0 :(得分:0)
PreMailer已发布更新。升级到1.5.5以解决此问题!无需回滚AngleSharp!