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? :^] )

CommentFileSizeAuthor
#2 twikifilter_match_restriction.patch1.34 KBsmokris

Comments

mradcliffe’s picture

Status: Active » Patch (to be ported)

Thank you kind sir for your information seeking only request.

made a commit.

smokris’s picture

StatusFileSize
new1.34 KB

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:

  • "twikifilter-wikiword" became "wiki"
  • "twikifilter-newwikiword" became "wikinew"

Is this a permanent change?

mradcliffe’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Assigned: Unassigned » mradcliffe