This issue seems to occur because Elk uses the textContent of the Mastodon HTML as a draft text (ref. 1, 2, 3, 4) and we are dropping the remaining URL string after 30 characters.
Here is an example content comparisons between Mastodon (first) and Takahē API (second):
- "content": "<p>Takahē - return to the wild - <a href=\"https://www.youtube.com/watch?v=IG423K3pmQI\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span class=\"invisible\">https://www.</span><span class=\"ellipsis\">youtube.com/watch?v=IG423K3pmQ</span><span class=\"invisible\">I</span></a></p>",
+ "content": "<p>Takahē - return to the wild - <a href=\"https://www.youtube.com/watch?v=IG423K3pmQI\" rel=\"nofollow\" class=\"ellipsis\" title=\"www.youtube.com/watch?v=IG423K\">www.youtube.com/watch?v=IG423K</a></p>",
To emulate Mastodon's link in content, this wraps the URL text with <span class="ellipsis"> and <span class="invisible">.
I kept the class="ellipsis" of the <a> tag untouched as I don't fully understand how it affects other parts of logic yet.
fixes #584
This issue seems to occur because Elk uses the textContent of the Mastodon HTML as a draft text (ref. 1, 2, 3, 4) and we are dropping the remaining URL string after 30 characters.
Here is an example
content
comparisons between Mastodon (first) and Takahē API (second):To emulate Mastodon's link in
content
, this wraps the URL text with<span class="ellipsis">
and<span class="invisible">
.I kept the
class="ellipsis"
of the<a>
tag untouched as I don't fully understand how it affects other parts of logic yet.https://takahe.shuuji3.xyz/@shuuji3@takahe.shuuji3.xyz/posts/184178424987558872/
https://elk.zone/takahe.shuuji3.xyz/@shuuji3/184178424987558872