Tags can also contain a .
[debian/pino.git] / debian / patches / 003_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 Forwarded: yes
5
6 --- a/src/template.vala
7 +++ b/src/template.vala
8 @@ -60,7 +60,7 @@
9                 
10                 //compile regex
11                 nicks = new Regex("(^|\\s)@([A-Za-z0-9_]+)");
12 -               tags = new Regex("((^|\\s)\\#[A-Za-z0-9_\\p{Latin}\\p{Greek}]+)");
13 +               tags = new Regex("(^|\\s|'|\\()#([A-Za-z0-9_-.\\p{Latin}\\p{Greek}]+)");
14                 groups = new Regex("(^|\\s)!([A-Za-z0-9_]+)"); //for identi.ca groups
15                 urls = new Regex("((http|https|ftp)://([\\S]+))"); //need something better
16                 
17 @@ -400,7 +400,7 @@
18                 }
19                 
20                 result = nicks.replace(result, -1, 0, "\\1@<a class='re_nick' href='userinfo://\\2'>\\2</a>");
21 -               result = tags.replace(result, -1, 0, "<a class='tags' href='%s\\1'>\\1</a>".printf(search_url));
22 +               result = tags.replace(result, -1, 0, "\\1#<a class='tags' href='%s\\2'>\\2</a>".printf(search_url));
23                 
24                 if(service == "identi.ca") //for identi.ca only
25                         result = groups.replace(result, -1, 0, "\\1!<a class='tags' href='http://identi.ca/group/\\2'>\\2</a>");