WordPress.org

Support

Support » Plugins and Hacks » Latest Tweets Widget » [Resolved] Swedish characters in hashtag breaks linkify

[Resolved] Swedish characters in hashtag breaks linkify

Viewing 7 replies - 1 through 7 (of 7 total)
  • I changed the preg pattern in twitter-api-utils.php line 29 to / +#(\p{Xwd}*)/u which seems to work. Any chance you could incorporate something like this in the next update of the plugin?

    Plugin Author timwhitlock

    @timwhitlock

    Thanks for this. I’ve never been sure of what characters *should* be allowed in a hashtag. This post is 4 years old, but the point still seems to stand.

    I suppose I had assumed that the WordPress esc_html call would escape accented characters in advance of the preg_replace call. Clearly you are right and this is not the case.

    I will look into this and will if possible match the exact syntax that twitter.com uses, if I can find it. I have looked before and I have given up.

    I’m hesitant to simply implement your fix, on two points. Firstly, I’m unsure if all WordPress users will have Unicode property support in their PCRE library and secondly I’m embarrassed to say I don’t understand your pattern. Could you explain what property codes the Xwd set refers to, please?

    I didn’t write the pattern myself I looked through a whole bunch of different ones, picked out a few ones that made sense to me and tried them out. This one I ended up with is from here

    http://stackoverflow.com/questions/22098426/prevent-preg-replace-replacing-special-characters

    It says that “\p{Xwd} has the same meaning that \w with all unicode letters and number and underscores.”

    I understand your concern! Maybe one could add a settings checkbox or something along those lines to allow unicode support. That way people can tick or untick it depending on whether it works with their systems.

    Plugin Author timwhitlock

    @timwhitlock

    I would sooner detect for support than add more checkboxes people won’t understand or need to be bothered with.

    I’ll see what I can do when I can find time. I’m glad your fix works for you, but I’ll need to test it thoroughly before adopting it. I will report back here if and when any change is deployed.

    Plugin Author timwhitlock

    @timwhitlock

    The current development version (which will become 1.1.0) has some fixes including better linkifying using actual entity data from twitter. Give it a try –

    Direct link to zip:
    http://downloads.wordpress.org/plugin/latest-tweets-widget.zip

    Plugin Author timwhitlock

    @timwhitlock

    Can anyone confirm whether this is resolved? Live version has various changes regarding linkifying.

    Plugin Author timwhitlock

    @timwhitlock

    Marking as resolved in the absense of a follow-up. The plugin uses official twitter hashtag metadata now anyway, so if there’s still a bug it’s a new issue now anyway.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Swedish characters in hashtag breaks linkify’ is closed to new replies.
Skip to toolbar