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

TypeScript syntax highlithing and twoslash autocompletion does not work in mdx files #172

Open
vecerek opened this issue Nov 3, 2022 · 1 comment

Comments

@vecerek
Copy link

vecerek commented Nov 3, 2022

Given the mdx vscode extension and the Twoslash VS code extension are both installed, these two files, and a docusaurus 2.0 setup with mdx:

repro.md
```ts twoslash
// ---cut---
const hi = "Hi" as const;
```
repro.mdx
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

<Tabs>
<TabItem value="val" label="Label">

```ts twoslash
// ---cut---
const hi = "Hi" as const;
```

</TabItem>
</Tabs>

I would expect the TypeScript code to be highlighted the same way in both files. Instead, I see this:

Screenshot 2022-11-03 at 23 21 07

Can you also reproduce this behavior, or is it just something with my local setup? 😅 Would you expect the twoslahs plug to work for both MD and MDX files?

@orta
Copy link
Contributor

orta commented Nov 3, 2022

I've never worked with mdx, so I didn't add support - you're welcome to add support though!

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

2 participants