From 053b5c5112a2044f6b0b12274f5d0647b52e3d62 Mon Sep 17 00:00:00 2001 From: Vincent Poulailleau Date: Tue, 3 Dec 2019 10:59:08 +0100 Subject: [PATCH] improve link management --- padpo/pofile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/padpo/pofile.py b/padpo/pofile.py index 360848f..2a03535 100644 --- a/padpo/pofile.py +++ b/padpo/pofile.py @@ -88,6 +88,9 @@ class PoItem: text = re.sub( r"\*(.*?)\*", r"« \1 »", text ) # TODO sauf si déjà entre «» + text = re.sub( + r"`(.*?)\s*<((?:http|https|ftp)://.*?)>`_", r"\1 (« \2 »)", text + ) text = re.sub(r"<((?:http|https|ftp)://.*?)>", r"« \1 »", text) return text