Hi,
I'm using a PHP script to convert certain strings (for example "ski holiday") to links. The problem is that the strings are also converted if they appear in subheaders (<H2>, example). I only want them converted if they appear in normal text (<P>).
The script I use (SH Autolink for WordPress) contain the regular expression below, which takes care of converting the strings.
$strText = preg_replace("|(?!<[^<>]*?)(?<![?./&])\b$strLinkname\b(?!:)(?![^<>]*?>)|imsU","<a target=\"$strTarget\" href=\"".$strProtocol."$strUrl\">$strLinkname</a>" , $strText, 1, $replaceCount);
How do I modify it, so strings in H2 tags aren't converted?
Thanks a lot, Brian