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

Characters < and > are not being escaped using Docusarus 3. #502

Closed
aamir1995 opened this issue Nov 17, 2023 · 4 comments
Closed

Characters < and > are not being escaped using Docusarus 3. #502

aamir1995 opened this issue Nov 17, 2023 · 4 comments

Comments

@aamir1995
Copy link

aamir1995 commented Nov 17, 2023

The following generated markdown will result in an error while using the plugin with Docusarus 3 and MDX 3.

> **new View**<`CameraControllerTypes`, `CameraControllerKind`>(
image

Probably need to escape these,

The issue can be reproduced by pasting the above problematic markdown in MDX Playground

This is also mentioned in upgrade guide of Docusarus V3 https://docusaurus.io/docs/migration/v3#common-mdx-problems

Environment Info:
Docusarus version: 3.0.0
@mdx-js/react: 3.0.0
docusaurus-plugin-typedoc: 1.0.0-next.21
typedoc-plugin-frontmatter: 0.0.2
typedoc-plugin-markdown: 4.0.0-next.27

@tgreyuk
Copy link
Member

tgreyuk commented Nov 17, 2023

Both opening and closing brackets should be escaped. Would you mind pasting in your source?

This looks like documentation of a class constructor but you should see this

> **new View**\<`CameraControllerTypes`, `CameraControllerKind`\>()

@CoderIllusionist
Copy link

CoderIllusionist commented Nov 27, 2023

@aamir1995 This plugin generates plain markdown files, docusaurus treats these (by default in V3) as mdx (which is not vanilla md) files. I had the exact same error you had, i fixed it by adding

  markdown: {
    format: 'detect'
  },

to docusaurus.config.ts. You can even test this in the MDX Playground link you provided by setting the input format to markdown

@DominicGBauer
Copy link

@CoderIllusionist thanks for the suggestion! I was having issues with using { } in a JS comment throwing an acorn error and using your suggestion fixed it.

@maerzhase
Copy link

@CoderIllusionist thanks man! this setting made my day :-)

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

No branches or pull requests

5 participants