-
Notifications
You must be signed in to change notification settings - Fork 22
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
Comments
Please help me <3 |
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. |
bobkataboo { type: "richtext", format: "markdown" }, change to { type: "richtext", format: "html" } |
I'm not sure why you're talking about converting markdown to html here? The problem (if I understand him correctly) is that the field originally already contained html and got converted to markdown for no apparent reason by this plugin. Let me add our use case to this: In my opinion this plugin should not do any transformation in fields that already contain html and just send the unmodified string to the provider (DeepL in our case). When I paste an html string manually into DeepL it translates it without problems & preverves the original html structure. You even suggested sending html to DeepL yourself in this post. |
Dear @JensUweB, You are completely right with your points there. If you use the CKEditor plugin, you need to set the format of the rich text appropriately: //…
translatedFieldTypes: [
"string",
{ type: "text", format: "plain" },
// rich text is html with CKEditor
{ type: "richtext", format: "html" },
"component",
"dynamiczone",
], The reason why I talked about the conversion is, that I was under the impression, that in the original issue, the actual richtext format was markdown (because of the given config). Only some parts in the markdown were html (like in this case the heading with a specific id), which cannot be transformed reliably by this plugin. |
@sargreal Oh my...I'm just a bit stupid, sorry! The error in my case was, that the translateFieldTypes option was in the wrong spot. I accidentally put it into providerOptions. No wonder it wasn't working. 😅 |
Describe the bug
I am using strapi-provider-translate-deepl. After running the translations my html
is turned to markdown
Expected behavior
remains html after translation
Plugin config
Please add your plugin config here, e.g.
The text was updated successfully, but these errors were encountered: