swap match adding order to try the Linux friendly one first. This should reduce reports of the libvte warning as being an error
This commit is contained in:
parent
202a0fd3b2
commit
bcb60d1807
|
@ -345,7 +345,7 @@ text/plain
|
||||||
pos = "bottom"
|
pos = "bottom"
|
||||||
return pos
|
return pos
|
||||||
|
|
||||||
def add_matches (self, lboundry="[[:<:]]", rboundry="[[:>:]]"):
|
def add_matches (self, lboundry="\\<", rboundry="\\>"):
|
||||||
userchars = "-A-Za-z0-9"
|
userchars = "-A-Za-z0-9"
|
||||||
passchars = "-A-Za-z0-9,?;.:/!%$^*&~\"#'"
|
passchars = "-A-Za-z0-9,?;.:/!%$^*&~\"#'"
|
||||||
hostchars = "-A-Za-z0-9"
|
hostchars = "-A-Za-z0-9"
|
||||||
|
@ -354,12 +354,14 @@ text/plain
|
||||||
user = "[" + userchars + "]+(:[" + passchars + "]+)?"
|
user = "[" + userchars + "]+(:[" + passchars + "]+)?"
|
||||||
urlpath = "/[" + pathchars + "]*[^]'.}>) \t\r\n,\\\"]"
|
urlpath = "/[" + pathchars + "]*[^]'.}>) \t\r\n,\\\"]"
|
||||||
|
|
||||||
|
dbg ('add_matches: trying a Linux-friendly match')
|
||||||
self.matches['full_uri'] = self._vte.match_add(lboundry + schemes + "//(" + user + "@)?[" + hostchars +".]+(:[0-9]+)?(" + urlpath + ")?" + rboundry + "/?")
|
self.matches['full_uri'] = self._vte.match_add(lboundry + schemes + "//(" + user + "@)?[" + hostchars +".]+(:[0-9]+)?(" + urlpath + ")?" + rboundry + "/?")
|
||||||
|
|
||||||
# FreeBSD works with [[:<:]], Linux works with \<
|
# FreeBSD works with [[:<:]], Linux works with \<
|
||||||
if self.matches['full_uri'] == -1:
|
if self.matches['full_uri'] == -1:
|
||||||
if lboundry != "\\<":
|
if lboundry != "[[:<:]]":
|
||||||
self.add_matches(lboundry = "\\<", rboundry = "\\>")
|
err ('add_matches: Linux match failed, trying alternative')
|
||||||
|
self.add_matches(lboundry = "[[:<:]]", rboundry = "[[:<:]]")
|
||||||
else:
|
else:
|
||||||
self.matches['addr_only'] = self._vte.match_add (lboundry + "(www|ftp)[" + hostchars + "]*\.[" + hostchars + ".]+(:[0-9]+)?(" + urlpath + ")?" + rboundry + "/?")
|
self.matches['addr_only'] = self._vte.match_add (lboundry + "(www|ftp)[" + hostchars + "]*\.[" + hostchars + ".]+(:[0-9]+)?(" + urlpath + ")?" + rboundry + "/?")
|
||||||
self.matches['email'] = self._vte.match_add (lboundry + "(mailto:)?[a-zA-Z0-9][a-zA-Z0-9.+-]*@[a-zA-Z0-9][a-zA-Z0-9-]*\.[a-zA-Z0-9][a-zA-Z0-9-]+[.a-zA-Z0-9-]*" + rboundry)
|
self.matches['email'] = self._vte.match_add (lboundry + "(mailto:)?[a-zA-Z0-9][a-zA-Z0-9.+-]*@[a-zA-Z0-9][a-zA-Z0-9-]*\.[a-zA-Z0-9][a-zA-Z0-9-]+[.a-zA-Z0-9-]*" + rboundry)
|
||||||
|
|
Loading…
Reference in New Issue