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

Escaping does not work properly in mdx editor #4503

Open
3 tasks done
KVPlotnikov opened this issue Apr 23, 2024 · 0 comments
Open
3 tasks done

Escaping does not work properly in mdx editor #4503

KVPlotnikov opened this issue Apr 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@KVPlotnikov
Copy link

Describe the issue that you're seeing. Any Loom videos or screenshots usually help a lot!

I am experiencing an issue with the MDX editor in TinaCMS where curly braces are not being escaped properly. When I input a string like GET/{uuid} into a rich-text field formatted in MDX, the editor initially adds an escape character (\) before the curly brace ({). However, after saving and reloading the document, the escape character disappears, and the editor throws an error saying "Unexpected expression uuid".
2024-04-23_17-15-45
2024-04-23_17-16-06
2024-04-23_17-16-22
2024-04-23_17-16-48

Reproduction

https://github.com/KVPlotnikov/tina-self-hosted-demo

Steps to reproduce

  1. Open the MDX editor in TinaCMS.
  2. Enter the string GET/{uuid} in a rich-text field.
  3. Switch the view from rich-text editor to MDX format view; observe that the editor automatically adds a \ before the {.
  4. Save the document and reload the page OR just switch to rich-text editor mode and then row-editor again.
  5. The previously added escape character is gone, and an error appears concerning the uuid expression.

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 10.45 GB / 31.85 GB
  Binaries:
    Node: 20.7.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - D:\projects\astral\landing\node_modules\.bin\yarn.CMD
    npm: 10.1.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 123.0.6312.123
    Edge: Chromium (123.0.2420.97)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @tinacms/auth: ^1.0.4 => 1.0.4
    @tinacms/cli: ^1.5.43 => 1.5.43
    @tinacms/datalayer: ^1.2.33 => 1.2.33
    tinacms: ^1.6.1 => 1.6.1

Validations

@KVPlotnikov KVPlotnikov added the bug Something isn't working label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant