Fix #872 by reserve null title string.#876
Merged
xoofx merged 4 commits intoxoofx:masterfrom Jun 5, 2025
Merged
Conversation
MihaZupan
reviewed
May 31, 2025
Contributor
Author
|
Sounds good, I misunderstood the meaning of callsite.
…---Original---
From: "Miha ***@***.***>
Date: Sat, May 31, 2025 23:23 PM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [xoofx/markdig] Fix #872 by reserve null title string. (PR #876)
@MihaZupan commented on this pull request.
In src/Markdig/Helpers/HtmlHelper.cs:
> @@ -465,6 +465,24 @@ private static bool TryParseHtmlTagProcessingInstruction(ref StringSlice text, r } } + /// <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)
I'm not suggesting to change the behavior of Unescape, but to change the one call site
-Title = HtmlHelper.UnescapeNullable(title, removeBackSlash: false), +Title = title is null ? null : HtmlHelper.Unescape(title, removeBackSlash: false),
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#872 reported an inconsistency between nullable annotation and possible value. In case of no title exists in a link syntax, consumers except
Titleproperty returns a null string. But current behavior isTitlereturning an empty string, This PR fixes the inconsistency by makeTitleproperty null if link title is not exist.