Skip to content

Commit ec2eef2

Browse files
committed
Remove HtmlHelper.UnescapeNullable
1 parent 6261660 commit ec2eef2

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

src/Markdig/Helpers/HtmlHelper.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -465,24 +465,6 @@ private static bool TryParseHtmlTagProcessingInstruction(ref StringSlice text, r
465465
}
466466
}
467467

468-
/// <summary>
469-
/// Destructively unescape a string: remove backslashes before punctuation or symbol characters.
470-
/// </summary>
471-
/// <param name="text">The string data that will be changed by unescaping any punctuation or symbol characters.</param>
472-
/// <param name="removeBackSlash">if set to <c>true</c> [remove back slash].</param>
473-
/// <returns>Unescaped text, or null if <paramref name="text"/> is null.<returns>
474-
public static string? UnescapeNullable(string? text, bool removeBackSlash = true)
475-
{
476-
if (text == null)
477-
{
478-
return null;
479-
}
480-
else
481-
{
482-
return Unescape(text, removeBackSlash);
483-
}
484-
}
485-
486468
/// <summary>
487469
/// Destructively unescape a string: remove backslashes before punctuation or symbol characters.
488470
/// </summary>

src/Markdig/Parsers/Inlines/LinkInlineParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ private bool TryProcessLinkOrImage(InlineProcessor inlineState, ref StringSlice
260260
link = new LinkInline()
261261
{
262262
Url = HtmlHelper.Unescape(url, removeBackSlash: false),
263-
Title = HtmlHelper.UnescapeNullable(title, removeBackSlash: false),
263+
Title = title is null ? null : HtmlHelper.Unescape(title, removeBackSlash: false),
264264
IsImage = openParent.IsImage,
265265
LabelSpan = openParent.LabelSpan,
266266
UrlSpan = inlineState.GetSourcePositionFromLocalSpan(linkSpan),

0 commit comments

Comments
 (0)