Elk coding later :) How do people feel about cleaning up links at the end of the post when there's already a preview card?
https://github.com/elk-zone/elk/pull/982
Conversation
Notices
-
Embed this notice
ayo (ayo@social.ayco.io)'s status on Saturday, 28-Jan-2023 18:21:36 JST ayo -
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 05:16:11 JST ayo ? trying to code live - come let's talk @elk and #opensource https://www.twitch.tv/ayoayco
In conversation permalink Attachments
-
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 05:16:19 JST ayo Here is the related issue I opened where I put the logic that will be applied, any ideas welcome!
In conversation permalink Elk repeated this. -
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 05:16:23 JST ayo This is gonna be a problem. ? HOW do we know when it is good for the context to leave it?
In conversation permalink Attachments
-
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 05:16:26 JST ayo Taking this on first, because I think it is relatively small
In conversation permalink -
Embed this notice
patak (patak@m.webtoo.ls)'s status on Sunday, 29-Jan-2023 19:25:02 JST patak @ayo Lovely ?
In conversation permalink -
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 19:25:06 JST ayo a before and after
In conversation permalink Attachments
-
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 19:25:09 JST ayo Removed the protocol part `https://` - it looks cleaner
In conversation permalink -
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 19:25:12 JST ayo Done. PR ready for review. Some screenshots
In conversation permalink Attachments
-
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 19:25:13 JST ayo IT'S WORKING NOW, JUST NEED TO CLEAN THE CODE
stuff to note:
1. we check if preview card URL matches the shared link href attribute
2. we don't need to check for multiple links, because the last link will never match the preview URL in this scenario
3. we append the cleaned link to the preview card "provider name" so people will still find this info --> meaning, we don't actually remove anything, but instead move it into the preview cardIn conversation permalink -
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 19:25:15 JST ayo Found that the preview card object generated by Mastodon is ALWAYS for the first link if there are multiple links in a post. This saves us work ? because the last link is never going to match the preview URL, and won't trigger the clean up logic
In conversation permalink -
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 19:25:18 JST ayo So close now... it's just that sometimes the preview card URL has a trailing `/` ?
In conversation permalink -
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 19:25:21 JST ayo The parse function seems not the best place as it is recursively going through node children... and I'm only concerned about the "last" not invisible child. ?
In conversation permalink -
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 19:25:23 JST ayo Uh, some invisible `<span>` elements are included at the end of the HTML content of a Status.... which means the link at the end of a post we see on Elk, is not the last child ?
In conversation permalink -
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 19:25:25 JST ayo Found the function that parses HTML content from the Status object, and we're going to add one transformation when the cleanup logic is triggered ;)
In conversation permalink -
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 19:25:27 JST ayo @elk Alright, I know we are cleaning up mentions somewhere... and I want to find and I'm going to do this link clean up beside that
In conversation permalink -
Embed this notice
ayo (ayo@social.ayco.io)'s status on Sunday, 29-Jan-2023 19:25:28 JST ayo @elk Come watch if you want to see me try to understand the code base ?
In conversation permalink
-
Embed this notice