Links don't work
kkoorndyk - July 2, 2008 - 20:40
| Project: | TWikifilter |
| Version: | 6.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | mradcliffe |
| Status: | closed |
Jump to:
Description
Entering a link such as: [[http://www.google.com][GOOGLE]] doesn't work. You see the string exactly as entered.

#1
Hi,
Have you setup an input format with the "TWiki Formatting Filter" enabled?
Edit: Is the input format selected when you're submitting or editing the node?
Sorry for any confusion.
#2
Yes, I have selected Twiki Formatting as the input format and tested various Twiki formats. Headings, bullets, etc. are all working. Links are the only thing not working for me currently.
#3
Hmm, I'm not sure what could be the issue.
I just wiped out one drupal installation I had, and rebuilt it. It seemed to work right out of the box. Maybe for some reason the module didn't get replaced or is in cache. Can you check if twikifilter.module contains this line?
line 309:
$mod = preg_replace("/\[\[$commonurls\]\[(\S+)\]\]/","<a href=\"$1\" title=\"$2\">$2</a>",$mod);Thanks.
#4
Huh. Yea, it appears to be there:
$mod = preg_replace("/\[\[$commonurls\]\[(\S+)\]\]/","<a href=\"$1\" title=\"$2\">$2</a>",$mod);#5
Arrgh. I'm not sure what's going on. It couldn't be a cache issue unless you made the node first, then enabled the filter later. But if you've edited the node since it would clear the cache.
Are you using any other filters?
#6
We did. I had the Custom Filter module installed and configured for MediaWiki formatting. We also have FCKeditor installed.
I think we're deciding to go with FCKeditor, but I can still mess around with the TWikifilter module to help debug this. Perhaps adding the TWikifilter again without the Custom Filter module will help?
#7
Okay, I added a rule like this to custom filter and added to my input format: /\[(\S+)\]/i
And of course it messes up the TWiki links. I'm assuming you did something similar before you ditched customfilter. I modified the regex for the customfilter to be a bit more specific, and it worked in conjunction with the TWiki bracket syntax:
/\[\[{,2}([A-Za-z0-9%\-_\/\\]+)[|](\S+)?\]{,2}/i = internal link/\[{,1}(A-Za-z0-9%\-_\/\\]+)(\s)?(\S+)?\]{,1}/i = external link
Also, when I removed the custom filter from the input format it updated the filter cache.
FCKeditor is pretty nice. I'll probably end up using it for another project.
#8