Fix (again) regex for identi.ca tags
authorJulien Valroff <julien@kirya.net>
Sat, 29 May 2010 06:30:54 +0000 (08:30 +0200)
committerJulien Valroff <julien@kirya.net>
Sat, 29 May 2010 06:30:54 +0000 (08:30 +0200)
debian/patches/004_fix-search-regex.diff

index 44bf562..1947317 100644 (file)
@@ -12,7 +12,7 @@ Index: pino/src/template.vala
                //compile regex
                nicks = new Regex("(^|\\s)@([A-Za-z0-9_]+)");
 -              tags = new Regex("((^|\\s)\\#[A-Za-z0-9_\\p{Latin}\\p{Greek}]+)");
-+              tags = new Regex("(^|\\s)#([A-Za-z0-9_\\p{Latin}\\p{Greek}]+)");
++              tags = new Regex("#([A-Za-z0-9_\\p{Latin}\\p{Greek}]+)");
                groups = new Regex("(^|\\s)!([A-Za-z0-9_]+)"); //for identi.ca groups
                urls = new Regex("((http|https|ftp)://([\\S]+))"); //need something better
                
@@ -21,7 +21,7 @@ Index: pino/src/template.vala
                
                result = nicks.replace(result, -1, 0, "\\1@<a class='re_nick' href='userinfo://\\2'>\\2</a>");
 -              result = tags.replace(result, -1, 0, "<a class='tags' href='%s\\1'>\\1</a>".printf(search_url));
-+              result = tags.replace(result, -1, 0, "\\1#<a class='tags' href='%s\\2'>\\2</a>".printf(search_url));
++              result = tags.replace(result, -1, 0, "#<a class='tags' href='%s\\1'>\\1</a>".printf(search_url));
                
                if(service == "identi.ca") //for identi.ca only
                        result = groups.replace(result, -1, 0, "\\1!<a class='tags' href='http://identi.ca/group/\\2'>\\2</a>");