WordPress.org

Ready to get started?Download WordPress

Forums

Really Simple Twitter Feed Widget
[resolved] Special characters in #hashtags (3 posts)

  1. Dick_Kalkman
    Member
    Posted 2 years ago #

    I found a problem / bug with the linkification of twitter #hashtags, that contain one or more special characters.
    Example: #Utøya (Norwegian)
    The solution might be changing the regex, so that it also selects a broad range of special foreign language characters.
    A nice list of foreign language characters ca be found on:
    http://www.vistawide.com/languages/typing_foreign_language_characters.htm
    Best Regards, Dick

  2. Dick_Kalkman
    Member
    Posted 2 years ago #

    This regex might solve 2 problems:

    1. The 'hyphen problem' in hashtags;
    2. The 'foreign language characters problem' in hashtags.

    '/(^|\s)#([\-\pL\w]+)/u'

    In the code:

    $msg = preg_replace('/(^|\s)#([\-\pL\w]+)/u', "$1#$2$3 ", $msg);

    So hashtags like #hour-s and #Utøya are so far now linkified.

    Best Regards, Dick

  3. whiletrue
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Dick,
    the 1.2.1 release fixes the bug you reported.

    Thanks for your cooperation!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic