Literal HTML tags visible with DeepL free tier API backend

Created on 26 May 2025, 5 days ago

Problem/Motivation

This may be related to 🐛 Markup lost/literal HTML tags visible Active , but it doesn't happen (only) with paragraphs, a plain body field shows the very issue as well: The translated text has literal (escaped) HTML tags in it, when using the DeepL free tier API.

Steps to reproduce

  1. Enter the following into the HTML source of a body field of a basic page (that's configured to be translatable):
    <p>
        hier kommt content her, ggf auch mit markup:
    </p>
    <ol>
        <li>
            eins
        </li>
        <li>
            zwei
        </li>
        <li>
            drei
        </li>
    </ol>
    <p>
        &nbsp;
    </p>
    <p>
        weiters hier noch <strong>fett</strong>, und wird das darüber in der Liste nicht übersetzt?
    </p>
  2. Save.
  3. Translate to English.

The "escaped HTML markup visible" case only occurs with DeepL (free tier) API, the problem goes away if I switch to Google API (see 🐛 Text parts with markup lost with Google API Active for problems that arise with Google API, however)

DeepL results in the following:

<p>
    &lt;p&gt;this is where content comes from, with markup if necessary:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;one&lt;/li&gt;&lt;li&gt;two&lt;/li&gt;&lt;li&gt;three&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;furthermore here also &lt;strong&gt;bold&lt;/strong&gt;, and is the above not translated in the list?&lt;/p&gt;
</p>

That is, HTML is escaped and literal tags are visible in CKEditor.

I have a fix that works for me, will create a MR shortly.

🐛 Bug report
Status

Active

Version

1.4

Component

Code

Created by

🇦🇹Austria tgoeg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024