WordPress.org

Ready to get started?Download WordPress

Forums

Twitter Feed: Embedded Timeline WordPress Plugin
[resolved] Hash tags get confused with HTML entities (5 posts)

  1. Cowboy_X
    Member
    Posted 1 year ago #

    I have a client who is using coded entities in his tweets — like & #8212; to do an em-dash. These are getting interpreted by the plugin as hash tags leading to "#8212" and breaking up the feed. (I assume they're being generated by a cruddy Twitter client that isn't converting entities to UTF-8.)

    I was able to fix this by editing your plugin by adding a space in your regular expression for detecting hash tags. A better version would check for the non-existence of an ampersand before the string, but I'm lazy.

    input:
    Ever wonder what is exactly meant by the 'flipped classroom'?

    output:
    Ever wonder what is exactly meant by the &<a href="http://twitter.com/search?q=%23039" rel="nofollow">#039</a>;flipped classroom&<a href="http://twitter.com/search?q=%23039" rel="nofollow">#039</a>;?

    line 208, edited:
    $tweet = preg_replace("( #([a-zA-Z0-9\_]+))", " <a href=\"http://twitter.com/search?q=%23\\1\" rel=\"nofollow\">\</a>", $tweet);

    http://wordpress.org/extend/plugins/wp-twitter-feed/

  2. mmapes
    Member
    Posted 1 year ago #

    Thanks, Cowboy_X. Hope this gets added to the new version. Mine was apostrophes turning into #039;.

    Note that encoding="yes" does NOT fix the problem.

  3. Nanette Kalisvaart
    Member
    Posted 1 year ago #

    Hi Cowboy_X,
    Would you know what I would need to change to prevent '&' being
    displayed as '& amp;' (but then withouth the space)?
    TIA

  4. dkromero
    Member
    Posted 1 year ago #

    Thank you Cowboy_X, with this amend works perfect.

  5. Alex Moss
    Member
    Plugin Author

    Posted 1 year ago #

    Hey guys - I've just updated to 1.2.2. Use decode="yes" in the shortcode to apply this fix.

    Thanks guys :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.