diff --git a/HtmlToOpenXml.sln b/HtmlToOpenXml.sln index 9a76efb7..02f801d5 100644 --- a/HtmlToOpenXml.sln +++ b/HtmlToOpenXml.sln @@ -3,15 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26730.16 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HtmlToOpenXml", "src\Html2OpenXml\HtmlToOpenXml.csproj", "{EF700F30-C9BB-49A6-912C-E3B77857B514}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{58520A98-BA53-4BA4-AAE3-786AA21331D6}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{84EA02ED-2E97-47D2-992E-32CC104A3A7A}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HtmlToOpenXml", "src\Html2OpenXml\HtmlToOpenXml.csproj", "{EF700F30-C9BB-49A6-912C-E3B77857B514}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo", "examples\Demo\Demo.csproj", "{A1ECC760-B9F7-4A00-AF5F-568B5FD6F09F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HtmlToOpenXml.Tests", "test\HtmlToOpenXml.Tests\HtmlToOpenXml.Tests.csproj", "{CA0A68E0-45A0-4A01-A061-F951D93D6906}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HtmlToOpenXml.Tests", "test\HtmlToOpenXml.Tests\HtmlToOpenXml.Tests.csproj", "{CA0A68E0-45A0-4A01-A061-F951D93D6906}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -24,7 +24,6 @@ Global {EF700F30-C9BB-49A6-912C-E3B77857B514}.Release|Any CPU.ActiveCfg = Release|Any CPU {EF700F30-C9BB-49A6-912C-E3B77857B514}.Release|Any CPU.Build.0 = Release|Any CPU {A1ECC760-B9F7-4A00-AF5F-568B5FD6F09F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A1ECC760-B9F7-4A00-AF5F-568B5FD6F09F}.Debug|Any CPU.Build.0 = Debug|Any CPU {A1ECC760-B9F7-4A00-AF5F-568B5FD6F09F}.Release|Any CPU.ActiveCfg = Release|Any CPU {A1ECC760-B9F7-4A00-AF5F-568B5FD6F09F}.Release|Any CPU.Build.0 = Release|Any CPU {CA0A68E0-45A0-4A01-A061-F951D93D6906}.Debug|Any CPU.ActiveCfg = Debug|Any CPU diff --git a/examples/Demo/Demo.csproj b/examples/Demo/Demo.csproj index f3ab651e..9c299552 100644 --- a/examples/Demo/Demo.csproj +++ b/examples/Demo/Demo.csproj @@ -1,23 +1,22 @@ - - + netcoreapp1.1 net35;net40;net46;netstandard1.4 Exe + + + + + 2.0 - - - - - \ No newline at end of file diff --git a/src/Html2OpenXml/Collections/TableStyleCollection.cs b/src/Html2OpenXml/Collections/TableStyleCollection.cs index e4debfe7..78fbad46 100755 --- a/src/Html2OpenXml/Collections/TableStyleCollection.cs +++ b/src/Html2OpenXml/Collections/TableStyleCollection.cs @@ -90,11 +90,17 @@ public void ProcessCommonAttributes(HtmlEnumerator en, IList run var colorValue = en.StyleAttributes.GetAsColor("background-color"); + if (colorValue.IsEmpty) //We do a first try, if it's empty the background-color, I try it with background + { + colorValue = en.StyleAttributes.GetAsColor("background"); + } + + // // "background-color" is also handled by RunStyleCollection which duplicate this attribute (bug #13212). - // Also apply on (issue #20). - // As on 05 Jan 2018, the duplication was due to the wrong argument passed during the td/th processing. - // It was the runStyle and not the containerStyle that was provided. The code has been removed as no more useful - if (colorValue.IsEmpty) colorValue = en.Attributes.GetAsColor("bgcolor"); + // Also apply on (issue #20). + // As on 05 Jan 2018, the duplication was due to the wrong argument passed during the td/th processing. + // It was the runStyle and not the containerStyle that was provided. The code has been removed as no more useful + if (colorValue.IsEmpty) colorValue = en.Attributes.GetAsColor("bgcolor"); if (!colorValue.IsEmpty) { containerStyleAttributes.Add( diff --git a/src/Html2OpenXml/HtmlToOpenXml.csproj b/src/Html2OpenXml/HtmlToOpenXml.csproj index 9c08c084..da02db5d 100755 --- a/src/Html2OpenXml/HtmlToOpenXml.csproj +++ b/src/Html2OpenXml/HtmlToOpenXml.csproj @@ -1,5 +1,4 @@ - - + netstandard1.4 net35;net40;net46;netstandard1.4 @@ -8,7 +7,7 @@ HtmlToOpenXml HtmlToOpenXml HtmlToOpenXml.dll - 2.0.1 + 2.0.1.1 https://github.com/onizet/html2openxml/raw/dev/docs/images/Home_h2oxnuget.png Copyright 2009-2018 For long-time follower, this is the next major release version since 1.6. @@ -31,26 +30,31 @@ You can see release note here: https://github.com/onizet/html2openxml/releases 2.0.0.0 https://github.com/onizet/html2openxml/blob/master/License.txt https://github.com/onizet/html2openxml - + + A library to convert simple or advanced html to plain OpenXml document Olivier Nizet true HtmlToOpenXml.snk true + 2.0.1.1 + + + + + 2.0 + {47B5D391-1B58-4162-9380-AB7D3BE6511A} - - - $(DefineConstants);FEATURE_NETHTTP;FEATURE_REFLECTION @@ -62,17 +66,20 @@ You can see release note here: https://github.com/onizet/html2openxml/releases $(DefineConstants);NET_CORE - + + MinimumRecommendedRules.ruleset + + + MinimumRecommendedRules.ruleset + - 4.3.0 - 4.3.0 @@ -81,5 +88,4 @@ You can see release note here: https://github.com/onizet/html2openxml/releases 4.3.0 - \ No newline at end of file