4185c015b27ec4c4012af4237b91ef8682c33831
[debian/pino.git] / debian / patches / 004_fix-search-regex.diff
1 Description: Fix regex for search/tags
2 Author: Julien Valroff <julien@kirya.net>
3 Bug: http://code.google.com/p/pino-twitter/issues/detail?id=141
4
5 Index: pino/src/template.vala
6 ===================================================================
7 --- pino.orig/src/template.vala 2010-05-23 15:26:40.000000000 +0200
8 +++ pino/src/template.vala      2010-05-23 15:29:14.000000000 +0200
9 @@ -60,7 +60,7 @@
10                 
11                 //compile regex
12                 nicks = new Regex("(^|\\s)@([A-Za-z0-9_]+)");
13 -               tags = new Regex("((^|\\s)\\#[A-Za-z0-9_\\p{Latin}\\p{Greek}]+)");
14 +               tags = new Regex("(^|\\s)#([A-Za-z0-9_\\p{Latin}\\p{Greek}]+)");
15                 groups = new Regex("(^|\\s)!([A-Za-z0-9_]+)"); //for identi.ca groups
16                 urls = new Regex("((http|https|ftp)://([\\S]+))"); //need something better
17                 
18 @@ -400,7 +400,7 @@
19                 }
20                 
21                 result = nicks.replace(result, -1, 0, "\\1@<a class='re_nick' href='userinfo://\\2'>\\2</a>");
22 -               result = tags.replace(result, -1, 0, "<a class='tags' href='%s\\1'>\\1</a>".printf(search_url));
23 +               result = tags.replace(result, -1, 0, "\\1#<a class='tags' href='%s\\2'>\\2</a>".printf(search_url));
24                 
25                 if(service == "identi.ca") //for identi.ca only
26                         result = groups.replace(result, -1, 0, "\\1!<a class='tags' href='http://identi.ca/group/\\2'>\\2</a>");