You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a Markdown renderer that formats user .md files into navigable .html pages.
Some user documents contain relative paths to a parent directory, like these:
Currently, LinkHelper.TryParseInlineLink calls LinkHelper.TryParseInlineLink, which calls LinkHelper.TryParseUrl leaving isAutoLink unset as false. This means that TryParseUrl treats the slash as escape character and effectively removes it.
The character is not recorded as a part of trivia, and there's no way to infer its presence by examining the AST.
Setting isAutoLink to true seems to address this issue, but I don't know what auto link is, and whether this is an appropriate wokaround.
I was thinking about a solution where we'd set a property on InlineProcessor.MarkdownPaserContext to influence LinkInlineParser.TryProcessLinkOrImage, but would like to get your opinion before making code changes.
The text was updated successfully, but these errors were encountered:
AmadeusW
changed the title
Unable to parse relative URL that starts with \..
Unable to parse relative URL to parent directories
Sep 30, 2024
While I do not recommend it - I pre-parsed markdown to rewrite the links to the standard, then passed that to this wonderful library. It's a pain, if you can get escaped unix style paths that's better.
I'm writing a Markdown renderer that formats user .md files into navigable .html pages.
Some user documents contain relative paths to a parent directory, like these:
Currently,
LinkHelper.TryParseInlineLink
callsLinkHelper.TryParseInlineLink
, which callsLinkHelper.TryParseUrl
leavingisAutoLink
unset asfalse
. This means thatTryParseUrl
treats the slash as escape character and effectively removes it.The character is not recorded as a part of trivia, and there's no way to infer its presence by examining the AST.
Setting
isAutoLink
to true seems to address this issue, but I don't know what auto link is, and whether this is an appropriate wokaround.I was thinking about a solution where we'd set a property on
InlineProcessor
.MarkdownPaserContext
to influenceLinkInlineParser.TryProcessLinkOrImage
, but would like to get your opinion before making code changes.The text was updated successfully, but these errors were encountered: