At least on my version of php (5.1.6), the "protection" clause here doesn't seem to work. Freelinking puts links into html tags, if, they happen to have CamalCase words in them... Unfortunately, for me, they do.
$pattern = '/\b' . $wikiword . '\b(?![^<]*>)/';
I think this is trying to say match a word break, then a wikiword, then a word break, which is not followed by any number of characters (not a <) followed by a >.
This is ok, except, of course,
MyWord/anythng you like>
Will still match, as it will match on MyWord/a (which satisfies the regexp I think).
I dont know if there is a way of making the lookahead patten "greedy", maybe that would solve it?
I personally have patched mine to do
$pattern = '/(?<=[\s,:.])' . $wikiword . '(?=[\s,:.])(?![^<]*>)/';
This matches a space, tab or newline, comma, colon or dot before and after the wiki word.
For me, this has the desired effect, because my CamelCase words happen to be part of a path....
But this is not a good solution....
Cheers
Mark.
Comments
Comment #1
eafarris commentedDuplicate of #48326.
Comment #2
frankgavin commentedDuplicate of #48326: Freelinking interferes with http: links containing CamelCasedWords.