Commit Graph

13 Commits

Author SHA1 Message Date
Mike Barnes e290df5499
Update LinkHelperTest.kt
Add test URLs for Bookwyrm
2023-08-07 19:43:03 +10:00
Konrad Pozniak d839f18267
update ktlint plugin to 11.3.1, format code (#3442) 2023-03-13 13:16:39 +01:00
Levi Bard 8ca92d9fde
Add new mastodon status url format to looksLikeMastodonUrl. (#3136)
Fixes #3092
2023-01-09 21:07:22 +01:00
Levi Bard 9e52f7acf1
Load goto social and microblog.pub urls in the app (#2945)
* Move looksLikeMastodonUrl to LinkHelper

* Add support for goto social and microblog.pub urls.
Closes #2893
2022-12-03 12:16:17 +01:00
kyori19 d1482324cc
Make URLSpans with trailing URL not marked up (#2813) 2022-11-16 18:28:00 +01:00
kyori19 a3d13b2743
Fix `markupHiddenUrls` destructs original CharSequence (#2814) 2022-11-15 19:02:35 +01:00
Levi Bard 21b3b53f93
Make bare domain detection more robust in link markup logic (#2792) 2022-11-15 18:05:26 +01:00
Levi Bard 58e8f75287
Don't markup urls where the display text is exactly the domain (#2732)
* Don't markup urls where the display text is exactly the domain (or www.thedomain)

* Remove unused arguments
2022-11-01 16:41:55 +01:00
Levi Bard 5d09a67b52
Fix the tag span generation for tags with nonascii characters (#2700)
* Update mention and tag regexes from mastodon

* Normalize nonascii tag names the same way that mastodon does
2022-09-17 19:06:45 +02:00
Levi Bard 687cffd540
Show target domains for non-mention/non-hashtag links where the target domain is not provided or differs from the domain in the text (#2698)
* Show target domains for non-mention/non-hashtag links where the target domain is not provided or differs from the domain in the text.
Addresses #2694

* Add link signifier to the marked-up domain

* Back down on validating hashtags and mentions, don't markup _any_ urls where the text starts with #/@
2022-09-17 19:06:07 +02:00
Levi Bard cdefcc441f
Fix relinkifying tags in posts from remote servers (#2359)
* Fix relinkifying tags in posts from remote servers

* Completely ignore urls, and (case-insensitively) match tag names instead
2022-02-28 16:54:25 +01:00
Conny Duck 842ab9e131 fix LinkHelperTest 2022-02-25 19:35:02 +01:00
Levi Bard addce87eb6
Use tags from status when adding handlers to hashtag spans in status content (#2344)
* Migrate LinkHelper to kotlin

* Support tags field on statuses

* Use embedded tags list in status instead of text scraping to embed tag click handler.
Fixes #2283

* Make mentions and tags lists nonnullable

* Make LinkHelper.openLink a Context extension method

* Use builtin extension for uri conversion

* More cleanup in LinkHelper

* Add tests for LinkHelper.getDomain

* Unbreak tags in places that don't have a tag list (e.g. profiles)

* Fixup javadoc
2022-02-25 18:56:21 +01:00