webdevnerdstuff / vue-code-block

Vue 3 CodeBlock - Highlight your code with ease using this syntax highlighting component powered by PrismJS or Highlight.js.
https://webdevnerdstuff.github.io/vue-code-block/
MIT License
37 stars 3 forks source link

[Bug Report]: Adding additional Hightlight.js languages not working #19

Closed webdevnerdstuff closed 1 year ago

webdevnerdstuff commented 1 year ago

Bug description

Importing of the additional languages is not working. Adding this issue to track it.

Steps to reproduce

  1. Try adding another hljs language.
  import hljs from 'highlight.js/lib/core';
  import langTypescript from 'highlight.js/lib/languages/typescript';

  hljs.registerLanguage('typescript', langTypescript);
  1. Notice there is an import error in the console.

Additional context

Complied code doesn't seem to be adding the importing of hightlight.js correctly.

Relevant code in CodeBlock.vue line 632. https://github.com/webdevnerdstuff/vue3-code-block/blob/main/src/plugin/CodeBlock.vue#L632

Code of Conduct