highlightjs / vue-plugin

Highlight.js Vue Plugin
BSD 3-Clause "New" or "Revised" License
207 stars 28 forks source link

`language` setting is not effective. #8

Closed yamanoku closed 3 years ago

yamanoku commented 3 years ago

I have specified highlightjs/vue-plugin from the one created in the Vue-cli template. https://codesandbox.io/s/bold-glitter-fl0e6?file=/src/main.js

However, even though I have specified the corresponding language in registerLanguage as per the README, the style is not reflected.

The language 'javascript' you specified could not be found

https://fl0e6.csb.app/


highlightjs/vue-plugin version: latest

joshgoebel commented 3 years ago

Does your project have two different HLJS versions in it's dependency tree?

https://github.com/highlightjs/vue-plugin/issues/1

wwwossai commented 3 years ago

@yamanoku manually reinstall the highlight.js@10.7.2(not latest) and it works.

npm i highlight.js@10.7.2

image

yamanoku commented 3 years ago

That's true, but I want to be able to use the latest version. I created this issue because I thought I could use this plugin with the latest version of highlight.js.

joshgoebel commented 3 years ago

Right now it's not possible to have two different versions in your dependency tree. Closing this as a dup of #1.

alonesuperman commented 1 year ago

https://github.com/highlightjs/vue-plugin/blob/454575aef428cdfe164156f2451cf3aecea7f74e/src/vue.ts#L25

it should be

const language = toRef(props, "language")