Remove HtmlHelper.UnescapeNullable

This commit is contained in:
Fa鸽
2025-06-04 19:23:18 +08:00
parent 6261660d37
commit ec2eef25b2
2 changed files with 1 additions and 19 deletions

View File

@@ -465,24 +465,6 @@ public static class HtmlHelper
}
}
/// <summary>
/// Destructively unescape a string: remove backslashes before punctuation or symbol characters.
/// </summary>
/// <param name="text">The string data that will be changed by unescaping any punctuation or symbol characters.</param>
/// <param name="removeBackSlash">if set to <c>true</c> [remove back slash].</param>
/// <returns>Unescaped text, or null if <paramref name="text"/> is null.<returns>
public static string? UnescapeNullable(string? text, bool removeBackSlash = true)
{
if (text == null)
{
return null;
}
else
{
return Unescape(text, removeBackSlash);
}
}
/// <summary>
/// Destructively unescape a string: remove backslashes before punctuation or symbol characters.
/// </summary>

View File

@@ -260,7 +260,7 @@ public class LinkInlineParser : InlineParser
link = new LinkInline()
{
Url = HtmlHelper.Unescape(url, removeBackSlash: false),
Title = HtmlHelper.UnescapeNullable(title, removeBackSlash: false),
Title = title is null ? null : HtmlHelper.Unescape(title, removeBackSlash: false),
IsImage = openParent.IsImage,
LabelSpan = openParent.LabelSpan,
UrlSpan = inlineState.GetSourcePositionFromLocalSpan(linkSpan),