懒得勤快 6 bulan lalu
induk
melakukan
48e2f3ea3e

+ 3 - 3
Masuit.Tools.Abstractions/HtmlSanitizer/HtmlSanitizer.cs

@@ -559,7 +559,7 @@ public class HtmlSanitizer : IHtmlSanitizer
                         foreach (var removedClass in removedClasses)
                             RemoveCssClass(tag, removedClass, RemoveReason.NotAllowedCssClass);
 
-                        if (!tag.ClassList.Any())
+                        if (tag.ClassList.Length == 0)
                             RemoveAttribute(tag, attribute, RemoveReason.ClassAttributeEmpty);
                     }
                     else if (!oldStyleEmpty && attribute.Name == StyleAttributeName && string.IsNullOrEmpty(attribute.Value))
@@ -658,7 +658,7 @@ public class HtmlSanitizer : IHtmlSanitizer
                 {
                     var e = new PostProcessNodeEventArgs(dom, node);
                     OnPostProcessNode(e);
-                    if (e.ReplacementNodes.Any())
+                    if (e.ReplacementNodes.Count != 0)
                     {
                         ((IChildNode)node).Replace([.. e.ReplacementNodes]);
                     }
@@ -874,7 +874,7 @@ public class HtmlSanitizer : IHtmlSanitizer
         if (iri != null && !iri.IsAbsolute && !string.IsNullOrEmpty(baseUrl))
         {
             // resolve relative URI
-            if (Uri.TryCreate(baseUrl, UriKind.Absolute, out Uri baseUri))
+            if (Uri.TryCreate(baseUrl, UriKind.Absolute, out Uri? baseUri))
             {
                 try
                 {

+ 2 - 2
Masuit.Tools.Excel/ExcelExtension.cs

@@ -17,14 +17,14 @@ public static class ExcelExtension
 {
     static ExcelExtension()
     {
-        ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+        ExcelPackage.License.SetNonCommercialPersonal("Test");
     }
 
 #if NET5_0_OR_GREATER
     [System.Runtime.CompilerServices.ModuleInitializer]
     internal static void Init()
     {
-        ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+        ExcelPackage.License.SetNonCommercialPersonal("Test");
     }
 #endif