-
Notifications
You must be signed in to change notification settings - Fork 76
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
Link parsing conflicts with autodetection when the link text happens to be recognized as something to link as well #62
Comments
Some additional information. The rationale for my conclusion is as follows: Debugging this: it looks like for the above text, the following sections of --> explicit link with link text
--> Auto detection
|
Test to confirm the above:
NOTE: The last assert also fails, which was unexpected. |
# Ensured that autodetect linking does not overlap existing links; which happens in case the link text contains text that could be auto detected as links.
* gentwo: simplification of the enumeration # Fix for Issue #62 # Ensured that autodetect linking does not overlap existing links; which happens in case the link text contains text that could be auto detected as links.
I didn't see assertion failures in your pull request. |
* master: fix macOS example updating to 2.1.4 #69: avoiding crash if font is missing project clang warning update Add Syntax Highlighting Add spacing to headers updating to 2.1.3 simplification of the enumeration # Fix for Issue #62 # Ensured that autodetect linking does not overlap existing links; which happens in case the link text contains text that could be auto detected as links. adding myself as author updating to 2.1.2 add ercentEscapesUsingEncoding # Conflicts: # CHANGELOG.md # README.md # TSMarkdownParser.podspec # TSMarkdownParser.xcodeproj/project.pbxproj # TSMarkdownParser/TSMarkdownParser.m # TSMarkdownParserExample OSX/ViewController.m # TSMarkdownParserTests/TSMarkdownParserTests.m
Consider the following markdown text:
In the above case, it appears that auto-detection overrides the original link (which does correctly identify the URL as mailto://foo@bar.com with the text of the link ie (foo@bar.com).
therefore works.
Not sure how this should be fixed, but one thought is that if a link text already has a link associated with it, then don't override with autodetect link... There may be more complicated use cases like:
ie the link text range and the autodetect link text range may be different. I am going to attempt to fix this, but would like to hear feedback on the above suggestion or other ideas on a solution.
The text was updated successfully, but these errors were encountered: