highlightjs / highlightjs/vue-plugin

Highlight.js Vue Plugin systematically ignores language value passed to it

Open
#49 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
241
Forks
29
PR merge metrics
No merged PRs in 30d

Description

Whether I call the plugin directly from my template section or mount it programmatically and passing to it a language prop value, the language I specify always ends up being ignored by the plugin who instead chooses himself a language.

From template section:

``

From script section (programmatically):

```

// some code here...

nextTick(() => {
mount(HighlightPlugin.component, {
element: document.querySelector('.myElement'),
props: {
language: 'javascript',
code: codeSnippet
}
})
})

```

Here's how the plugin is imported in my main.js:

```
import 'highlight.js/styles/github-dark-dimmed.css'
import 'highlight.js/lib/common'
import hljsVuePlugin from '@highlightjs/vue-plugin'
app.use(hljsVuePlugin)

app.mount('#app')
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.