-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
Remove LinkSpan in favor of URLSpan #34
Comments
On a second thought, offering a global I could send a PR if you want. |
Second update: oh wow, I just realized that both these problems can be solved by simply making |
Hey @Saketme ! Thanks for kind words and interest in the project! Please tell me (after all the updates 😉 ) if extending I also find that using TextPaint's |
Hahaha, you can see my third update here: https://github.com/Saketme/Markwon/commits/saket.linkspan I made The current |
@Saketme hey! Sorry for late reply. I have just created a new branch for the next I would like if you could check how it works for your use-case 🙌 The solution is a bit different. If |
No problem. I just tested the commit and it seems to be working perfectly. Thank you :) |
Hey @noties, thanks for open sourcing this project. You have saved me a lot of time. Small suggestion about links. I think that the existence of
LinkSpan
is not justified in Markwon. It requires extra effort to support it and breaks compatibility with other libraries.Replacing it with
URLSpan
will enable,Android to pick-up
textColorLink
from TextView's theme instead of picking it from the Context's theme. This is a problem if I use Application context for supplying aSpannableConfiguration
object through my Dagger graph.Third-party libraries like my Better-Link-Movement-Method and perhaps others that work with
URLSpan
for extracting links will continue to work just fine. My library will treat the text as the url ifClickableSpan
was found instead of anURLSpan
.The responsibility of resolving links is not on a markdown processing library. This could be optional, but the responsibility of handling links should be left to
MovementMethod
.In case you're wondering why can't I just register a
LinkResolver
to fix this problem, I extract the location of aURLSpan
using a customMovementMethod
that also keeps a track ofTouchEvent
s. This let's me display contextual popups where the links are present.Thoughts?
The text was updated successfully, but these errors were encountered: