[Plugin: Acronyms] Fix for Acronym plugin breaking BBCode
-
The Acronyms plugin is smart enough not to replace acronyms inside of HTML tags, but when I noticed that the plugin broke [caption] code in my posts, I discovered that it will replace acronyms inside of BBCode tags, thus breaking them. All that is needed to fix this is a slight modification of the regular expression it uses.
If you replace the fourth line of the acronyms_replace function (line 377) with the following code, everything should work fine.
$text = preg_replace( "|(?!<[^<>]*?)(?!\[[^\[\]]*?)(?<![?.&])\b$acronym\b(?!:)(?![^\[\]]*?\])(?![^<>]*?>)|msU", "<acronym title=\"$fulltext\">$acronym</acronym>" , $text );
Hope that helps anyone who’s been having trouble with this plugin!
- The topic ‘[Plugin: Acronyms] Fix for Acronym plugin breaking BBCode’ is closed to new replies.