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

How can I use highlighting props on fence? #154

Open
buhodev opened this issue Apr 22, 2024 · 2 comments
Open

How can I use highlighting props on fence? #154

buhodev opened this issue Apr 22, 2024 · 2 comments

Comments

@buhodev
Copy link

buhodev commented Apr 22, 2024

Is your feature request related to a problem? Please describe.
I got markdoc + shiki working. However, I couldn't find a way to use {} syntax for highlighting

Describe the solution you'd like
Is it possible to pass this string as a prop on the fence component? (in this case is {1-2,4} next ot the lang prop)

```js {1-2,4}
console.log('hello');
console.log('world');

let number = 42;
```

I already have a custom fence component, but I couldn't manage to pass another variable or prop next to the lang prop

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context

Here's an example of how to add code highlighting from markdoc docs

@TorstenDittmann
Copy link
Owner

I dont think markdoc supports this syntax as of right now 🤔

@TorstenDittmann
Copy link
Owner

Actually it is possible => markdoc/markdoc#480 (comment)

But the preprocessor only allows the default attributes right now, so this will result in an error for now.

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