Translation API textType Html issue

Brian 6 Reputation points
2022-10-05T19:24:20.89+00:00

Hi There,

I came across a bug when using the Translate API v3. Using the textType='html', specifically for french.

Example input:

  • from: 'EN'
  • to: 'FR'
  • textType: 'html'
  • data: [{ Text: "<p><span style="font-size: 10pt;">This is some test text with a link <a title="This is just a random link title" href="https://www.google.com" target="_blank" rel="noopener">this is a random link for testing</a></span></p>"}]

RETURNS -->
text: "<p><span style="font-size: 10pt;">Il s’agit d’un texte de test avec un lien <a title="Ceci est juste un titre de lien aléatoire » href="https://www.google.com » target="_blank » rel="noopener">il s’agit d’un lien aléatoire pour les tests</a></span></p>"

As you can see from the response of the API, it replaces ' " ' at the end of the href and target with ' » '. This breaks the <a></a> tag completely.

Azure Translator
Azure Translator
An Azure service to easily conduct machine translation with a simple REST API call.
343 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Brian 6 Reputation points
    2022-10-18T17:27:19.293+00:00

    Hello @YutongTie-MSFT

    It is resolved now, thanks. Seems to have been the query param "textType"='html' was left out causing the above issue.

    1 person found this answer helpful.