Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors in LinkHelper and LinkInlineParser. #837

Merged
merged 7 commits into from
Dec 27, 2024
Merged

Conversation

snnz
Copy link
Contributor

@snnz snnz commented Dec 21, 2024

Here is what I used to fix #830. LinkHelper.TryParseTitle is replaced with more structured and clearer one, check it out.

src/Markdig/Parsers/Inlines/LinkInlineParser.cs Outdated Show resolved Hide resolved
src/Markdig/Parsers/Inlines/LinkInlineParser.cs Outdated Show resolved Hide resolved
src/Markdig/Parsers/Inlines/LinkInlineParser.cs Outdated Show resolved Hide resolved
src/Markdig/Parsers/Inlines/LinkInlineParser.cs Outdated Show resolved Hide resolved
src/Markdig.Tests/TestPlayParser.cs Outdated Show resolved Hide resolved
snnz and others added 5 commits December 21, 2024 06:13
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
@snnz
Copy link
Contributor Author

snnz commented Dec 21, 2024

I've applied the suggestions.

By the way, since backslashes are already handled by LinkHelper, and there is fortunately that option, removeBackSlash, I didn't touch HtmlHelper.Unscape itself. But it is also used somewhere else, and doesn't look right: 1) it's this function that eats all the backslashes in a sequence except one, and 2) method CharHelper.IsEscapableSymbol that it uses to determine whether to unescape a character or to preserve the backslash, for some reason adds '•' as escapable symbol. Why is that?

…e ending regardless of whether it is followed by a line feed or not.
@xoofx xoofx merged commit d1233ff into xoofx:master Dec 27, 2024
1 check passed
@xoofx xoofx added the bug label Dec 27, 2024
@snnz snnz deleted the fix-links branch December 28, 2024 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple errors in LinkHelper
3 participants