Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9aafeeb commit c6b3929Copy full SHA for c6b3929
Source/HtmlRenderer/Core/Utils/HtmlUtils.cs
@@ -370,8 +370,12 @@ private static string DecodeHtmlCharByCode(string str)
370
num = num * (hex ? 16 : 10) + CommonUtils.ToDigit(str[endIdx++], hex);
371
endIdx += (endIdx < str.Length && str[endIdx] == ';') ? 1 : 0;
372
373
+ string repl = string.Empty;
374
+ if (num >= 0 && num <= 0x10ffff && !(num >= 0xd800 && num <= 0xdfff))
375
+ repl = Char.ConvertFromUtf32((int)num);
376
+
377
str = str.Remove(idx, endIdx - idx);
- str = str.Insert(idx, Convert.ToChar(num).ToString());
378
+ str = str.Insert(idx, repl);
379
380
idx = str.IndexOf("&#", idx + 1);
381
}
0 commit comments