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

Request to expose internal methods #236

Closed
deammer opened this issue Dec 14, 2023 · 3 comments
Closed

Request to expose internal methods #236

deammer opened this issue Dec 14, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@deammer
Copy link

deammer commented Dec 14, 2023

Hello, it would be amazing to expose the following as exports:

  • normalizeTokens()
  • useTokenize()

I'm currently facing a situation where I want to insert elements between lines of code and I'd like to do it outside of the <Highlight> component, but I still want the tokenization improvements performed by normalizeTokens().

Does this make sense?

@carloskelly13
Copy link
Contributor

@deammer We've published a new patch version at 2.3.1 which should expose these functions.

@deammer
Copy link
Author

deammer commented Dec 18, 2023

Thank you @carloskelly13 and team! Love that you took the time to add documentation, too.

@johnrengelman
Copy link

Is there an example of how to use the output of useTokenize? It says you can use this function and pass the tokens to <Highlight /> but I don't see how to do that as it still requires passing the code property and then providing the rendering functioning.

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

No branches or pull requests

4 participants