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

Make more modular, support passing hljs to initializer (i.e. prevent needing to bind hljs to window) #77

Open
whatl3y opened this issue Jun 8, 2020 · 2 comments

Comments

@whatl3y
Copy link

whatl3y commented Jun 8, 2020

Is your feature request related to a problem? Please describe.
No, simply want to support a more modular approach to initializing this package to prevent having to pollute the window with hljs.

Describe the solution you'd like
To be able to pass hljs as a variable in an initializer function/factory/etc. for highlightjs-line-numbers.js to prevent having to bind hljs to the window first.

Describe alternatives you've considered
N/A

Additional context
N/A

@awb99
Copy link

awb99 commented May 15, 2021

For me this is a problem. I am trying to use your project, but the way how I require highlight.js is in a way that does not create widow.hljs. Therefore your code fails.

@NGPixel
Copy link

NGPixel commented Apr 29, 2023

I refactored this library for esm, from which you can pass the hljs instance directly:

https://github.com/requarks/highlightjs-line-numbers-esm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants