onizet / html2openxml

Html2OpenXml is a small .Net library that convert simple or advanced HTML to plain OpenXml components. This program has started in 2009, initially to convert user's comments into templated Word.
MIT License
321 stars 109 forks source link

Fix SetProperties to work with the latest OpenXML version #78

Closed mattiamerzi closed 4 years ago

mattiamerzi commented 4 years ago

Compiling html2openxml with the current master branch of OpenXML fails running Unit Tests with this error:

System.InvalidOperationException : Boolean SetElement(DocumentFormat.OpenXml.OpenXmlElement) is not a GenericMethodDefinition. MakeGenericMethod may only be called on a method for which MethodBase.IsGenericMethodDefinition is true.

Stack: RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation) OpenXmlStyleCollectionBase.SetProperties(OpenXmlCompositeElement containerProperties, OpenXmlElement tag) line 165 ParagraphStyleCollection.ApplyTags(OpenXmlCompositeElement paragraph) line 47 HtmlConverter.CompleteCurrentParagraph(Boolean createNew) line 701 HtmlConverter.ProcessBlockQuote(HtmlEnumerator en) line 110 HtmlConverter.ProcessHtmlChunks(HtmlEnumerator en, String endTag) line 206 HtmlConverter.Parse(String html) line 110 AbbrTests.ParseWithLinks(String html, String expectedUri) line 44

onizet commented 4 years ago

Hello, thank you for your PR. What is different than #71 ?

mattiamerzi commented 4 years ago

Hello, thank you for your PR. What is different than #71 ?

The difference is that #71 fixes problem appeared with the introduction of the 2.11.0 release of OpenXML, instead, this fixes a problem that only happens if you try to run html2openxml linked to the latest master branch.

renemadsen commented 3 years ago

When will there be a release with this fix included in a release?

Currently we have projects, which are not working because of this bug.

onizet commented 3 years ago

This is fixed now in 2.2.0