We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a07a859 + c6b3929 commit 0729edfCopy full SHA for 0729edf
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