Posted by smokris on March 17, 2009 at 10:33pm
| Project: | TWikifilter |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | mradcliffe |
| Status: | patch (to be ported) |
Issue Summary
The regex for matching standalone WikiWords (i.e., those without squarebrackets) seems to be a bit too liberal. For example, it picks up WikiWords in the following contexts, which I think it should try to avoid:
<a title="WikiWord" /> (linking should be avoided for all html tag attributes)<a>WikiWord</a> (linking should be avoided for the ctext of the html anchor tag)/private/var/tmp/WikiWord(Perhaps this might be a good opportunity to write some simpletests? :^] )
Comments
#1
Thank you kind sir for your information seeking only request.
made a commit.
#2
Thanks, Matt. This seems to fix case #2 ("avoid linking to ctext within html anchor tag").
The fix doesn't address singleton HTML tags, so #1 is still broken. Adding
$htmlsingletonregex = "<[^>]+\/>";works for me.#3 can be addressed by adding something like
$pathregex = "(\/[\w\-]+)+\/?";.I've attached a patch that fixes these additional cases.
Also, I noticed your modification changed the CSS classes:
Is this a permanent change?
#3