Skip to content

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

Open
@whatl3y

Description

@whatl3y

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

Activity

awb99

awb99 commented on May 15, 2021

@awb99

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

NGPixel commented on Apr 29, 2023

@NGPixel

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Make more modular, support passing hljs to initializer (i.e. prevent needing to bind hljs to window) · Issue #77 · wcoder/highlightjs-line-numbers.js