Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bobkataboo opened this issue Sep 22, 2023 · 2 comments
Open

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

bobkataboo opened this issue Sep 22, 2023 · 2 comments

Comments

@bobkataboo
Copy link

bobkataboo commented Sep 22, 2023

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 ...
    },
  },
}
@bobkataboo
Copy link
Author

Please help me <3
I need this as it's stopping the releasing of our new websites

@sargreal
Copy link
Member

Hi @bobkataboo and thank you for opening this issue!

As we are working voluntary here, we cannot provide you with a time frame on when we can fix this.

Also, because showdown, the tool we use currently to achieve the translation of markdown by translating the markdown to html and back, does not support this, it is not a trivial fix.

The easiest workaround for now could be to enable some kind of automatic id generation in your markdown to html converter in the frontend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants