Comments (1)
Confirmed. I see this problem as well. It's come up in a few toots and I have to copy the link out of the embedded browser after visiting it and manually correct it.
Amaroq does not parse or link URLs correctly when they are preceded by punctuation or symbol characters.
I have a series of test cases in this thread:
https://infosec.exchange/@AlainODea/100261452240133300
Here they are for convenience to copy into test cases (I've replaced my domain with example.com):
Bare, no path:
https://example.com
Parens, no path:
(https://example.com)
Brackets, no path:
[https://example.com]
Braces, no path:
{https://example.com}
Comma, no path:
,https://example.com
Period, no path:
.https://example.com
Bare, root path:
https://example.com/
Parens, root path:
(https://example.com/)
Brackets, root path:
[https://example.com/]
Braces, root path:
{https://example.com/}
Comma, root path:
,https://example.com/
Period, root path:
.https://example.com/
Bare, ASCII path:
https://example.com/en/archives/2007/9
Parens, ASCII path:
(https://example.com/en/archives/2007/9)
Brackets, ASCII path:
[https://example.com/en/archives/2007/9]
Braces, ASCII path:
{https://example.com/en/archives/2007/9}
Comma, ASCII path:
,https://example.com/en/archives/2007/9
Period, ASCII path:
.https://example.com/en/archives/2007/9
Bare, ASCII path+query:
https://example.com/en/archives/2007/9?lang=en_CA
Parens, ASCII path+query:
(https://example.com/en/archives/2007/9?lang=en_CA)
Brackets, ASCII path+query:
[https://example.com/en/archives/2007/9?lang=en_CA]
Braces, ASCII path+query:
{https://example.com/en/archives/2007/9?lang=en_CA}
Comma, ASCII path+query:
,https://example.com/en/archives/2007/9?lang=en_CA
Period, ASCII path+query:
.https://example.com/en/archives/2007/9?lang=en_CA
The web UI from the Mastodon reference implementation renders all of these as the expected links (matching the bare examples above). Ironically (but cleverly in my mind), this relies on extract_entities_with_indices and extract_urls_with_indices from Twitter's Open Source twitter-text Gem.
I think Amaroq parses URLs from Toots using this:
Amaroq/Pods/ActiveLabel/ActiveLabel/RegexParser.swift
Lines 15 to 17 in 983ef5d
That won't work beyond unambiguous, clearly isolated URLs in Toots. This isn't an easy problem to solve yourself, but you can use the Objective-C version of twitter-text. The Mastodon reference implementation does that, it's Apache 2.0 licensed.
I haven't touched Objective-C in over a decade or iOS programming at all yet, so the yak shave involved in me diving in here to fix this myself is very high. Normally, I would post a PR with a fix, not an issue. Hopefully, that's okay. Hopefully, my test reduction and identification of candidate libraries and corresponding solutions in other clients will help though.
from amaroq.
Related Issues (20)
- Language problem for belgiul HOT 1
- [Feature] Add Support for Pleroma
- Multiple Account Ability HOT 1
- Care to explain the Gab Ban? HOT 1
- [Deprecated] Avoid calling NSUserDefaults synchronize HOT 1
- " " not converted to non-breaking space HOT 1
- Strange account shows up in "My instances" and "My profile"
- Following remote users leads to "http 404 raise_not_found" on mastodon instance HOT 4
- Image order should be preserved just like selected
- UIControlEvent action for follow icon seems to be failing HOT 3
- Pixelfed compatibility
- [Feature] Support Misskey
- Feature: French localization HOT 4
- Bug: Xcode - Failed to install the requested application HOT 6
- Login screen flashes when opening app
- Login screen truncates description
- Handling of invalid client_id
- URL linkification detection error
- Amaroq strips newlines and links
- [Feature Request] LibreTranslate support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amaroq.