Dienstag, 30. Juli 2013

wordpress hashtag plugin color bugfix

color bugfix for the v0.1 #hashtag plugin: http://wordpress.org/plugins/hashtag/

Problem:
# the plugin matches hash tags in span / color code: (red)


Solution:
hashtag/hashtag.php in function hashtag_regex_replace

ORIGINAL:
#$content = preg_replace('/(^|\s)#(\w*[a-zA-Z_]+\w*)/i', '\1#\2', $content);

CHANGETO:
$content = preg_replace('/(?!:).(^|\s)#(\w*[a-zA-Z_]+\w*)/i', '\1#\2', $content);

#(?!:).

Kommentar veröffentlichen