This filter is awesome and just what I was looking for, but it only works with double quotes. Could you update the process function (lines 79 &80) so that it also filters when within single quotes?
The reason I ask is I have a JavaScript where the path is single quoted and this filter doesn't work.
I'd patch this but I really have very little clue about GREP (I think that's what this is), it looks more like cartoon cursing than something I know how to read. :-)
Here are the two lines in question:
return preg_replace('/"internal:([^"#\?]+)\??([^"#]+)?#?([^"]+)?"/e',
"'\"'. url('$1', '$2' ? '$2' : NULL, '$3' ? '$3' : NULL, ". $absolute .") .'\"'", $text);
Comments
Comment #1
dsoneira commentedI'm facing the same problem when I want to use this filter with a javascript call like this one:
onClick="window.open('internal:node/52','Popup title','width=765,height=610,resizable=yes,scrollbars=yes');return false;"Here is my changed code. This solution does not break the double quote (standard) links. Maybe it is helpful for someone having a similar issue:
Please note: I did not look into doing anything pretty - I just wanted to make it work (fast) ;)
Comment #2
dsoneira commentedHere is an improved version with a back reference (\1) at the end, so that whatever is used to start the expression (single or double quotes) has also to end it.
My first try (see last post) also matches "internal:node/52' - which is incorrect.
Now it's either "internal:double_quotes" or 'internal:single_quotes'
Comment #3
mrfelton commentedThis is fixed in CVS now.
Comment #4
mrfelton commentedmarking this as 'to be ported' so I don't forget to backport the changes.
Comment #5
mrfelton commentedAlso fixed in the latest D5 code.