Skip to content

Commit e112b9a

Browse files
committed
Rely on native code for HtmlDecode
1 parent 4cce9c8 commit e112b9a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Html2OpenXml/IO/DataUri.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ public static bool TryCreate(string uri, out DataUri? result)
8484
if (match.Groups["base64"].Length > 0)
8585
{
8686
// be careful that the raw data is encoded for url (standard %xx hex encoding)
87+
#if NET5_0_OR_GREATER
88+
string base64 = System.Web.HttpUtility.HtmlDecode(match.Groups["data"].Value);
89+
#else
8790
string base64 = HttpUtility.HtmlDecode(match.Groups["data"].Value);
91+
#endif
8892

8993
try
9094
{

0 commit comments

Comments
 (0)