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

docusaurus-preset-shiki-twoslash seems to conflict with docusaurus's magic comments #177

Open
ymc9 opened this issue Jan 11, 2023 · 1 comment

Comments

@ymc9
Copy link

ymc9 commented Jan 11, 2023

Hi,

Docusaurus2 has this nice thing called "magic comments" that adds styling to code blocks (like line highlighting etc.) with comments. It seems that whenever I enable shiki-twoslash plugin, magic comments stops working.

Is this a known issue? Thanks!

@perfectbase
Copy link

@ymc9 I just had the same problem, but I figured it out.
Not sure if it will help in your case, but if you just want the highlighting, shiki has it's own way:

```ts twoslash {1, 3-4}
function greet(person: string) {
  console.log(`Hello ${person},`)
  console.log(`How do?`)
}
greet("Maddison")
```

https://shikijs.github.io/twoslash/

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