Hash tags get confused with HTML entities
-
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="https://twitter.com/search?q=%23039" rel="nofollow">#039</a>;flipped classroom&<a href="https://twitter.com/search?q=%23039" rel="nofollow">#039</a>;?
line 208, edited:
$tweet = preg_replace("( #([a-zA-Z0-9\_]+))", " <a href=\"https://twitter.com/search?q=%23\\1\" rel=\"nofollow\">\</a>", $tweet);
https://www.ads-software.com/extend/plugins/wp-twitter-feed/
- The topic ‘Hash tags get confused with HTML entities’ is closed to new replies.