]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* camelcase: Tighten regexp to avoid false positives. WikiWords are only
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 28 Sep 2007 20:50:20 +0000 (20:50 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 28 Sep 2007 20:50:20 +0000 (20:50 +0000)
  linkified now if they are preceeded by whitespace.

IkiWiki/Plugin/camelcase.pm
debian/changelog
doc/bugs/parsing_for_WikiWords_should_only_be_done_outside_html_tags.mdwn

index dc89f1b90ec8c039a6ce3adbe8ee03cb60ae30df..845a516ee5e0d02d4080e08fab386d009db31c52 100644 (file)
@@ -16,10 +16,11 @@ sub filter (@) { #{{{
        # Make CamelCase links work by promoting them to fullfledged
        # WikiLinks. This regexp is based on the one in Text::WikiFormat.
        $params{content}=~s{
        # Make CamelCase links work by promoting them to fullfledged
        # WikiLinks. This regexp is based on the one in Text::WikiFormat.
        $params{content}=~s{
-               (?<![[|"/>=])   # try to avoid expanding non-links
-                               # with a zero width negative lookbehind for
-                               # characters that suggest it's not a link
-               \b              # word boundry
+               (?<![^A-Za-z0-9\s])     # try to avoid expanding non-links
+                                       # with a zero width negative
+                                       # lookbehind for characters that
+                                       # suggest it's not a link
+               \b                      # word boundry
                (
                        (?:
                                [A-Z]           # Uppercase start
                (
                        (?:
                                [A-Z]           # Uppercase start
index 081af219f04a594cf365c506f1a835bb7df4fbfc..7d581cbf253b3fdcb40360c975867f6728f190d1 100644 (file)
@@ -19,8 +19,10 @@ ikiwiki (2.9) UNRELEASED; urgency=low
   * Don't allow whitespace in link text in a wikilink. This was still
     allowed by the regexp in one case though not documented to work, and
     was ambiguous with preprocessor directives.
   * Don't allow whitespace in link text in a wikilink. This was still
     allowed by the regexp in one case though not documented to work, and
     was ambiguous with preprocessor directives.
+  * camelcase: Tighten regexp to avoid false positives. WikiWords are only
+    linkified now if they are preceeded by whitespace.
 
 
- -- Joey Hess <joeyh@debian.org>  Mon, 24 Sep 2007 12:48:35 -0400
+ -- Joey Hess <joeyh@debian.org>  Fri, 28 Sep 2007 16:45:29 -0400
 
 ikiwiki (2.8) unstable; urgency=low
 
 
 ikiwiki (2.8) unstable; urgency=low
 
index 7f108ff12fc96b3cf7b1283785a9f04f7ed0de7b..44938c7547a2942c516c4d5defecf493b470e5ef 100644 (file)
@@ -3,7 +3,15 @@ When having a link to e.g. http://www.chumba.com/media/Chumbawamba-EnoughIsEnoug
 You can see an example of the breakage on <http://wiki.debian-community.org/planets/de/> - scroll down to the Chumbawamba entry.
 
 >> There's a great workaround for this bug: Disable the
 You can see an example of the breakage on <http://wiki.debian-community.org/planets/de/> - scroll down to the Chumbawamba entry.
 
 >> There's a great workaround for this bug: Disable the
->> [[plugins/camelcase]] plugin. :-)
+>> [[plugins/camelcase]] plugin. :-) I really don't recommend using that
+>> plugin. _Especially_ not when aggregating third-party content as you do
+>> in the example.
+>> 
+>> Fixing this at the html parsing level would involve making ikiwiki 2
+>> times slower, not even counting the html parsing overhead, since it
+>> would have to fully render pages in the "scan" pass.
+>>
+>> All I can do is improve the regexp it uses to try to avoid false
+>> positives. Which I've now [[done]].
 >> 
 >> 
->> The fix involves modifying its regexp to look for surrounding brackets.
 >> --[[Joey]]
 >> --[[Joey]]