Skip to content

Hashtag link detection is inconsistent with web UI #959

Open
@Tamschi

Description

@Tamschi

Mastodon for Android requires the hashtag class on anchor elements to treat them as hashtag links:

if(el.hasClass("hashtag")){
String text=el.text();
if(text.startsWith("#")){
linkType=LinkSpan.Type.HASHTAG;
href=text.substring(1);
linkObject=tagsByTag.get(text.substring(1).toLowerCase());

The web interface does not (and also covers hashtag links with outer "#"): https://github.com/mastodon/mastodon/blob/67a8d4638c6e6a3ef178258504a6535746608c42/app/javascript/hooks/useLinks.ts#L13-L15

This occasionally causes trouble: snarfed/bridgy-fed#1634 (comment)

It would be good to have parity here. Personally I'd prefer the behaviour of the web version, as I think I saw a post where the link didn't cover the "#".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions