Unexpected heading signs added to a closing tag in mdx file

  • Platform (static site generator): Docusaurus
  • File format: mdx (v3)
  • Project & sample file location: kaia-docs > public-recover-msg.mdx
  • Sample file download (If you compare two files, you can see the difference)
  • Symptom: Crowdin changes some of mdx syntaxes unexpectedly when generating translation mdx files from source mdx files. Specifically, the original block is as follows:
</CH.Code>
---
Import the **@klaytn/web3js-ext** packages to add klaytn features on web3

But Crowdin renders it like the following in any of translation language. I can see numerous instances that show this behavior:

## </CH.Code>

Import the **@klaytn/web3js-ext** packages to add klaytn features on web3

As a result, it causes mdx compilation error when building the site:

Error: MDX compilation failed for file "./kaia-docs/i18n/ko/docusaurus-plugin-content-docs/current/references/sdk/web3js-ext/account-management/sign-message/public-recover-msg.mdx"
Cause: Expected the closing tag `</CH.Code>` either after the end of `atxHeading` (52:14) or another opening tag after the start of `atxHeading` (52:1)

Thanks in advance.

Hi @klaytn.docs,

Thank you for reaching out to us,

I’ve forwarder this issue to our tech team for investigation,

Let’s keep in touch,

Hi @klaytn.docs

Our devs suggest adding an empty line before the --- dashes in your file

For example, your string:

</CH.Code>
---

How you can modify it:

</CH.Code>

---

https://daringfireball.net/projects/markdown/syntax#header

Additionally, we can recommend switching to the mdx_v2 parser. There is no such problem there and generally better support for jsx syntax.

It can be done it Project settings → Parser configuration → Change file type:

I need to note that after changing this setting it will be applied to the newly uploaded files only. Those that were uploaded before will remain unchanged.

1 Like