or c) detect that authentication is required and so give up trying to fetch the title. Instead could leave the cursor: `[|](pasted url)` where the upright bar is, ready for user to type something helpful instead. or b) the simple version of this is just to use the domain part of the URL (before the third slash).
Jonathan Clark: This is the solution I would expect.
As for (b), I can imagine some settings tab in the app where one could enter a regexp for URL matching and transformation of the URL into a title. But this one is for technical people like me, of course, and not a universal solution (would not help in case of Google Sheets, for example). So probably you would not consider implementing it... Another "workaround" solution that came to my mind would be a simple UX tweak: when one pastes URL into NotePlan and NotePlan detects the title and inserts it, you could automatically make the title SELECTED, so that it would be easy to override it manually just by typing instantly. This is more of a workaround than a solution to original issue, but it would be quite convenient. Because as we all know, manual precise text selection has always been a pain on iOS devices (not as much pain on desktop, but such behaviour there would also help a lot in dealing with link titles).
Yeah, this is a tricky one. There are ways to authenticate, I have used it to call PHP scripts earlier. But not sure how to do that here (yet).
Eduard Metzger: How the titles are fetched now? Is the anything unusual (e.g. pretending to be a browser) while fetching the url? E.g. youtube started resolving to a popup title recently and pasting https://www.youtube.com/watch?v=TURbeWK2wwg results in "Before you continue to YouTube" while e.g. `curl "https://www.youtube.com/watch?v=TURbeWK2wwg"` returns html with "4 A.M Study Session 📚 - [lofi hip hop/chill beats] - YouTube" in the html title so it would not appear that they are blocking scraping in any way.
Marcin Ignac: I'm using a Swift method: https://developer.apple.com/documentation/swift/string/31267… But apparently it's not following redirects or so. I need to use a different method which has more configuration options.
Eduard Metzger: As this is still ongoing problem in 2024 could we at least have defaults for top domains?
Marcin Ignac: you mean show the top domain of the url?
Eduard Metzger: top domain at least and if possible smarter handling of top linked websites like social media so it could be [x.com/@marcinignac] instead of bunch of [x.com] links. Maybe not a bad idea for a plugin... find all [Link] links and apply rules @handles for twitter, repo names for GitHub, parse titles from Notion links etc
Hello wouldn’t implementing the universal Option+Shift+Command+V (paste text without any formatting) do the trick here ? It could result on pasting the normal url, and would be very useful for other cases I presume ... Of course this would imply having choice to paste markdown or plain text from any copied text (part of a webpage; ...), and that's another story :)