Skip to content

ZWNJ is not supported in hashtags #11761

Closed

Description

@ahangarha

Expected behaviour

I expect ZWNJ to be included in hashtag. I need whole of "نرم‌افزار" be a hashtag.

Actual behaviour

By now, Hashtag only includes non-ZWNJ characters. So in the given example above, only "نرم" gets converted to link.

Steps to reproduce the problem

You just add #نرم‌افزار and see how it only includes نرم as hashtag.

Specifications

It is a general bug in Mastodon

Activity

  1. nightpool commented on Sep 4, 2019

    @nightpool
    Member

    you're gonna have to fight this one out with @marrus-sh, i have no idea what the correct behavior should be

  2. trwnh commented on Sep 5, 2019

    @trwnh
    Member

    FWIW Twitter/Instagram/etc do the same, and the general behavior of users is to use underscores between words in joined languages.

  3. ahangarha commented on Sep 5, 2019

    @ahangarha
    ContributorAuthor

    This is not correct. Both twitter and Instagram support ZWNJ in hashtag. It is needed in Persian. ِYou may check this link from twitter.

  4. Gargron commented on Sep 5, 2019

    @Gargron
    Member

    So is this just about including \u200C in the hashtag regex or are there more characters than that?

  5. ahangarha commented on Sep 5, 2019

    @ahangarha
    ContributorAuthor

    I believe it only only this is needed to be there.

  6. added a commit that references this issue on Sep 13, 2019
    72c56ca
  7. added a commit that references this issue on Sep 13, 2019
    0762258
  8. marrus-sh commented on Sep 23, 2019

    @marrus-sh
    Contributor

    late reply but concur that both ZWJ and ZWNJ should be included in hashtags; it is WORD JOINER and ZWSP which should not

    i know some people used ZWJ/ZWNJ as hashtag-breakers in some cases but i have always advocated use of WJ instead

  9. marrus-sh commented on Sep 23, 2019

    @marrus-sh
    Contributor

    (A more lengthy response:

    U+2060 WORD JOINER (WJ) and U+200B ZERO WIDTH SPACE (ZWSP) [in addition to U+FEFF ZERO WIDTH NO-BREAK SPACE (BOM), but it should never be used for this purpose] are invisible format characters for controlling the breaking (as in, line­‑breaking) of text. Although there might conceivably be use­‑cases for controlling (preventing) line­‑breaking in hashtags, this is generally a layout concern which should be controlled through higher­‑order mechanisms (CSS) and not a linguistic issue (something inherent to the hashtagʼs meaning). As invisible layout characters, they are good candidates for things like "preventing a # from opening a hashtag by placing WJ after it", which is primarily a layout concern.

    U+200C ZERO WIDTH NON-JOINER (ZWNJ) and U+200D ZERO WIDTH JOINER (ZWJ) (which should probably also be added to the regex if not present @Gargron) are invisible format characters for controlling the ligation (how ligatures form) of text. This does have linguistic meaning in many scripts, including Arabic (and Persian), Devanagari, and Emoji (👩‍💻). So it should be allowed in hashtags and does form a significant and meaningful aspect of their value.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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