[tomboy] bgo #531085 Addresses improper handling of links. Patches submitted by Sandy Armstrong and Aaron Bor
- From: Jared L Jennings <jjennings src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tomboy] bgo #531085 Addresses improper handling of links. Patches submitted by Sandy Armstrong and Aaron Bor
- Date: Sun, 26 Jun 2011 06:20:47 +0000 (UTC)
commit 32bc77abf14c4163f89a00174adcc560f123eec3
Author: Jared Jennings <jjennings src gnome org>
Date: Sun Jun 26 01:25:13 2011 -0400
bgo #531085 Addresses improper handling of links.
Patches submitted by Sandy Armstrong and Aaron Borden
Tomboy/Watchers.cs | 40 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
---
diff --git a/Tomboy/Watchers.cs b/Tomboy/Watchers.cs
index 105205e..4c906d8 100644
--- a/Tomboy/Watchers.cs
+++ b/Tomboy/Watchers.cs
@@ -374,7 +374,45 @@ namespace Tomboy
Gtk.TextMark click_mark;
const string URL_REGEX =
- @"((\b((news|http|https|ftp|file|irc)://|mailto:|(www|ftp)\.|\S* \S*\ )|(?<=^|\s)/\S+/|(?<=^|\s)~/\S+)\S*\b/?)";
+ //@"((\b((news|http|https|ftp|file|irc)://|mailto:|(www|ftp)\.|\S* \S*\ )|(?<=^|\s)/\S+/|(?<=^|\s)~/\S+)\S*\b/?)";
+ @"("+
+ @"(("+
+ @"((?<=(?<starter>("+ // preceded by a starter
+ @"(?<starterA>(\())"+ // opening parenthesis closed by )
+ @"|(?<starterB>(\[))"+ // or opening bracket closed by ]
+ @"|(?<starterC>(\{))"+ // or opening thing closed by }
+ @")))"+
+ @"|\b)"+ // or at beginning of a word \b
+ @"("+
+ @"(news|http|https|ftp|file|irc)://"+ // http:// ...
+ @"|mailto:"+ // or mailto...
+ @"|(www|ftp)\."+ // or www...
+ @"|\S* \S*\ "+ // or email adress
+ @")"+
+ @")"+
+ @"|("+
+ @"((?<=(?<starter>("+ // preceded by a starter
+ @"(?<starterA>(\())"+ // opening parenthesis closed by )
+ @"|(?<starterB>(\[))"+ // or opening bracket closed by ]
+ @"|(?<starterC>(\{))"+ // or opening thing closed by }
+ @")))"+
+ @"|(?<=^|\s))"+
+ @"("+
+ @"(/\S+/)"+ // or starting with '/'
+ @"|(~/\S+?)"+ // or starting with '~/'
+ @")"+
+ @"))"+
+ @"(?(starter)"+ //
+ @"(\S(?!("+ // if starter detected : forbid ender
+ //ignore this comment (for syntax) ([{
+ @"(?(starterA)\)|"+ // closing parenthesis
+ @"(?(starterB)\]|"+ // closing bracket
+ @"(?(starterC)\})))"+ // closing thing
+ @")))*\S?"+
+ @"|\S*/?"+ // else anything without space
+ @")"+
+ @")";
+
static Regex regex;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]