ckolderup / postmarks

a single-user bookmarking website designed to live on the Fediverse
https://postmarks.glitch.me
MIT License
464 stars 38 forks source link

Hashtag Spacing and Empty Tag Handling #161

Closed jeffsikes closed 11 months ago

jeffsikes commented 11 months ago

Resolves #159

Noticed another issue where a single "undefined" tag was getting included when the tag attribute was missing from the bookmark object. Added handling for that scenario.

A note about differences across apps for hashtag linking. Phanpy and Elk both leave the inline href values as submitted, so it ends up going back to our personal Postmark instances in a new window and displaying them there.

All other apps are replacing the hashtag links with /tags/{tagName} so it shows tags as related to the current instance you're viewing the post on.

jeffsikes commented 11 months ago

Hi! Yes, after I checked a few additional apps, I noticed the manual line breaks were being removed in some apps, and in others it made the spacing look odd (two lines before the hashtag line). The most compatible path I found was to wrap the main content in a <p> tag and then the same with the hashtags <p>. This provided consistent results across all apps I tested.

In addition to that fix, I also noticed a pre-existing issue. If you enter a bookmark with no tags and no description, an extra line was being added at the end (assuming a description would be there). So, fixed that as well, checking for a description before adding the extra line break.

Some of the attributes aren't being honored like the target="_blank" so I removed it as well.

During my testing, I also noticed a bug in Ivory. If you only enter a title (title with URL link), Ivory just removed the link altogether and just displays the preview card. So if you added a custom title it isn't included.

I have all of my testing scenarios and apps I've been testing in, happy to provide that if it would be helpful in some way for automation in the future?

Aside - I'm running out of real links from my Raindrop.io account to use on my official site. 🤣 I think I'm gonna have to build a separate one for AP testing.