mirror of https://gitlab.com/bashrc2/epicyon
Link style
parent
e3c696a0b3
commit
e33eec9ff9
|
@ -241,13 +241,17 @@ def _libretranslate(url: str, text: str,
|
||||||
|
|
||||||
translatedText = \
|
translatedText = \
|
||||||
'<p>' + json.loads(response_str)['translatedText'] + '</p>'
|
'<p>' + json.loads(response_str)['translatedText'] + '</p>'
|
||||||
|
|
||||||
|
# append links form the original text
|
||||||
if links:
|
if links:
|
||||||
for url in links:
|
for url in links:
|
||||||
urlDesc = url
|
urlDesc = url
|
||||||
if len(urlDesc) > 30:
|
if len(urlDesc) > 30:
|
||||||
urlDesc = urlDesc[:30]
|
urlDesc = urlDesc[:30]
|
||||||
translatedText += \
|
translatedText += \
|
||||||
'<p><a href="' + url + '">' + urlDesc + '</a></p>'
|
'<p><a href="' + url + \
|
||||||
|
'" rel="nofollow noopener noreferrer" target="_blank">' + \
|
||||||
|
urlDesc + '</a></p>'
|
||||||
return translatedText
|
return translatedText
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue