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
All three should be valid and interpreted as links. But rxmarkdown only interprets (1) as a link. The others are ignored and rendered as [link!](example.com) and [link!](56366) in the output.
presumed cause
com.yydcdut.markdown.syntax.text.HyperLinkSyntax#contains seems to be broken.
It return in all three cases false. While it should actually return true in all three cases.
As a result, you only check in line 60 the AUTO_LINK_PATTERN regex to see if you can do auto linking in this line. And for case (1) this actually works. That's why line (1) is interpreted correctly as a link but the other two not.
you increment i and findPosition in the method calls which results in incorrect behaviour. I guess replacing eg. ++i with i+1 (and the same for findPosition would solve the problem.
On the other hand, I'm not entirely sure, why you need this method at all. Isn't matching with the PATTERN regex from the same file enough to detect whether the string contains a markdown link? It looks like the method tries to do the same as matching the regex programmatically (but does it faulty).
regards,
Simon
The text was updated successfully, but these errors were encountered:
Hello,
while trying to hook into hyperlink processing (to make relative links work), I realized that hyperlink parsing in general seems to be broken.
problem
Suppose we have a markdown like
All three should be valid and interpreted as links. But rxmarkdown only interprets (1) as a link. The others are ignored and rendered as
[link!](example.com)
and[link!](56366)
in the output.presumed cause
com.yydcdut.markdown.syntax.text.HyperLinkSyntax#contains
seems to be broken.It return in all three cases
false
. While it should actually returntrue
in all three cases.As a result, you only check in line 60 the
AUTO_LINK_PATTERN
regex to see if you can do auto linking in this line. And for case (1) this actually works. That's why line (1) is interpreted correctly as a link but the other two not.The problem lies in line 106 and following.
Here
you increment
i
andfindPosition
in the method calls which results in incorrect behaviour. I guess replacing eg.++i
withi+1
(and the same forfindPosition
would solve the problem.On the other hand, I'm not entirely sure, why you need this method at all. Isn't matching with the
PATTERN
regex from the same file enough to detect whether the string contains a markdown link? It looks like the method tries to do the same as matching the regex programmatically (but does it faulty).regards,
Simon
The text was updated successfully, but these errors were encountered: