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

Shiki Magic Move ignores transformers from ./setup/shiki.ts #1462

Open
Sdju opened this issue Mar 23, 2024 · 2 comments
Open

Shiki Magic Move ignores transformers from ./setup/shiki.ts #1462

Sdju opened this issue Mar 23, 2024 · 2 comments
Labels
enhancement New feature or request upstream

Comments

@Sdju
Copy link
Contributor

Sdju commented Mar 23, 2024

  1. create setup/shiki.ts
  2. add some transformers eg
/* ./setup/shiki.ts */
import { defineShikiSetup } from '@slidev/types'
import { transformerNotationDiff, transformerNotationWordHighlight } from '@shikijs/transformers'

export default defineShikiSetup(() => {
  return {
    themes: {
      'dark': 'min-light',
      'light': 'min-light',
    },
    transformers: [
      transformerNotationWordHighlight(),
    ]
  }
})

2.1 add some basic styles for class highlighted-word
3. add new slide with some content with shiki magic move and some content without it

```html
// [!code word:article]
<article>
  <h1>
    Hello
  </h1>
</article>
```

````md magic-move
```html
// [!code word:article]
<article>
  <h1>
    Hello
  </h1>
</article>
```
````
  1. check the result
    image

As i can see there is difference betwheen the magic move version and the version without it. In the documentation no clues about that. In the shiki config gide too.

  • OS: windows 10
  • Browser: Chrome 122.0.6261.112
  • Slidev version: 0.48.7

I really want to use word highlighting + magic move. If it is not possible then the documentation should warn about it.

Thank You!

@antfu
Copy link
Member

antfu commented Mar 23, 2024

Unfortunately, Magic Move does not support transformers at this moment

@Sdju
Copy link
Contributor Author

Sdju commented Mar 23, 2024

Thank You for answering!

It's OK. Then, i think. the documentation should contain this information

Something like this: #1464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request upstream
Projects
None yet
Development

No branches or pull requests

3 participants