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

extend language 'groovy' and language definition for 'groovy' could not be registered. #15

Closed
zycoJamie opened this issue Feb 7, 2022 · 2 comments
Labels
dependencies Pull requests that update a dependency file

Comments

@zycoJamie
Copy link

env:
vue 3.2.11
vue-diff 1.1.3
highlight.js 11.4.0

description:

import VueDiff from 'vue-diff';
import 'vue-diff/dist/index.css';
import groovy from 'highlight.js/lib/languages/groovy';
VueDiff.hljs.registerLanguage('groovy', groovy);

i want to extend language, but i fail, i get an error "Language definition for 'groovy' could not be registered.", because 'hljs.regex' is undefined.

function groovy(hljs) {
  const regex = hljs.regex; // undefined
  const IDENT_RE = '[A-Za-z0-9_$]+';
  .....
}

the highlight.js of vue-diff's dependencies is "^10.5.0", 'hljs.regex' does not exist in here.

but the highlight.js of my project's dependencies is "^11.4.0", 'hljs.regex' is defiined.

version difference of the highlight.js causes problems.

github-actions bot pushed a commit that referenced this issue Feb 7, 2022
### [1.1.4](v1.1.3...v1.1.4) (2022-02-07)

### Refactor

* [#15](#15) Update highlight.js major version ([5c550dd](5c550dd))
@hoiheart
Copy link
Owner

hoiheart commented Feb 7, 2022

I patched the dependencies and released version 1.1.4.
Please check it out. 😀

@hoiheart hoiheart added the dependencies Pull requests that update a dependency file label Feb 7, 2022
@zycoJamie
Copy link
Author

it is solved. 😁👏🏻

@hoiheart hoiheart closed this as completed Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

2 participants