Skip to content

[BUG]: After translation html tags are turned to markdown #316

@bobkataboo

Description

@bobkataboo

Describe the bug
I am using strapi-provider-translate-deepl. After running the translations my html

<h2 id="1">
text
</h2>

is turned to markdown

## text

Expected behavior

<h2 id="1">
text
</h2>

remains html after translation

Plugin config
Please add your plugin config here, e.g.

module.exports = {
  translate: {
    enabled: true,
    config: {
      // Choose one of the available providers
      provider: "deepl",
      // Pass credentials and other options to the provider
      providerOptions: {
        // your API key - required and wil cause errors if not provided
        apiKey: env("DEEPL_API_KEY"),
        // use custom api url - optional
        tagHandling: "html",
        apiUrl: "https://api-free.deepl.com",
        // use custom locale mapping (for example 'en' locale is deprecated so need to choose between 'EN-GB' and 'EN-US')
        localeMap: {
          // use uppercase here!
          EN: "EN-US",
        },
        translatedFieldTypes: [
          "string",
          { type: "text", format: "plain" },
          { type: "richtext", format: "markdown" },
          "component",
          "dynamiczone",
        ],
        apiOptions: {
          // see <https://github.com/DeepLcom/deepl-node#text-translation-options> for supported options.
          // note that tagHandling Mode cannot be set this way.
          // use with caution, as non-default values may break translation of markdown
          tagHandling: "html",
          formality: "default",
          // ...
        },
      },
      // other options ...
    },
  },
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions