When I translate HTML code that contains HTML comment Deepl throws an exception :
Bad request, message: Tag handling parsing failed, please check input.
'text without parent'
If I remove the HTML comment the translation is done successfully. Also with tag_handling_version parameters set to "v1" no errors are thrown.
text = """
<!-- this is a comment -->
<p>a paragraph</p>
<p>another</p>
"""
translator = deepl.Translator(key)
result = translator.translate_text(
text,
source_lang="EN",
target_lang="FR",
tag_handling="html",
tag_handling_version="v2",
)
current version of deepl-python is 1.28.0