From 35219af5ea41be8bf6bc8b363b1db38083433524 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 20 Jul 2021 21:04:49 +0100 Subject: [PATCH] Remove links during translation --- languages.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/languages.py b/languages.py index f39298d1e..a1fe7b4d3 100644 --- a/languages.py +++ b/languages.py @@ -220,6 +220,10 @@ def _libretranslate(url: str, text: str, # LibreTranslate doesn't like markup text = removeHtml(text) + # remove any links from plain text version of the content + for _, url in links.items(): + text = text.replace(url, '') + ltParams = { "q": text, "source": source,