Closed
Description
Describe the bug
When translating a English text with HTML elements to French, the response contains unexpected additional HTML Tags and often a full sentence that was not in the input.
To Reproduce
Minimal JS Script to reproduce the Error (last tested on March 9th 2024 6PM CET)
const deepl = require('deepl-node')
const authKey = "<authkey>"
const translator = new deepl.Translator(authKey)
async function translate(targetLang) {
const result = await translator.translateText('<p><strong>Testing the system</strong></p>', 'en', targetLang, tag_handling = 'html')
console.log(result)
}
translate('de')
translate('fr')
This results in the following responses:
{
text: '<p><strong>Test des Systems</strong></p>',
detectedSourceLang: 'en'
}
{
text: "</p><strong>Tester le système</strong></p><strong></p><strong>La mise en place d'un système de gestion de l'information est une priorité.",
detectedSourceLang: 'en'
}
The German translation is correct but the French translation has <strong></p><strong>La mise en place d'un système de gestion de l'information est une priorité.
appended to a seemingly correct result.
I've noticed that without the <strong>
Tag it does not happen but I have not tested that exhaustively.
Thank you very much.
Metadata
Metadata
Assignees
Labels
No labels