Open pbtsrc opened 1 year ago
Another example. text=
<p>1-<i>London, Paris</i></p>
translate_text returns:
<p>1-London<i>, Paris</i></p>
Same result with tag_handling='html' and tag_handling='xml'
@pbtsrc By chance, are you using both tag_handling
and preserve_formatting
parameters?
No, I did not use preserve_formatting. I tried to add this parameter, but it did not change anything.
text=
translate_text(text, source_lang='EN', target_lang='DE', tag_handling='html') for the above text returns this:
As you can see the content of
<a>
has lost its tail (lich, weiter). If we use tag_handling='xml' all works as expected:If we replace
<div>
with<p>
there will be no issue either.