From 3b7e5f93bdc649fd65a3b7d301a90fe56b6c918e Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 5 Feb 2021 20:34:16 +0100 Subject: link plugin: fix regex for aesgcm and add gemini&gopher --- plugins/link.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/link.py b/plugins/link.py index 4961d5ef..699215ea 100644 --- a/plugins/link.py +++ b/plugins/link.py @@ -87,8 +87,17 @@ from poezio.xhtml import clean_text from poezio import common from poezio import tabs -url_pattern = re.compile(r'\b(?:http[s]?://(?:\S+))|(?:magnet:\?(?:\S+))|(?:aesgcm://(?:\Z+))\b', - re.I | re.U) +url_pattern = re.compile( + r'\b' + '(?:http[s]?://(?:\S+))|' + '(?:magnet:\?(?:\S+))|' + '(?:aesgcm://(?:\S+))|' + '(?:gopher://(?:\S+))|' + '(?:gemini://(?:\S+))' + '\b', + re.I | re.U +) + app_mapping = { 'Linux': 'xdg-open', 'Darwin': 'open', -- cgit v1.2.3