I am using prism through npm and I've tried to language-ruby language-bash language-shell and I don't get any highlighting at all. However If I do language-javascript it works. I'm not sure why its not working. Can anyone help?
You need to include the components for the languages you want to use. Or you can use the Autoloader plugin.
The thing is that the prism.js file you currently use is the one used on the website: it already comes bundled with a few components (Markup, CSS, JS, the File Highlight plugin). The standalone library is the prism-core.js component.
@donnieflorence I just done it like this:
import "prismjs"
import "prismjs/components/prism-typescript"
@Golmote I'm using Slate-Prism, a package which adds Prism highlighting to the SlateJS text editor.
It uses a line, Prism.languages, which obviously only includes the core languages. Could you elaborate a little on how to add languages to Prism?
Nevermind. That was really easy... I just added the require and it was added to the list of languages... Amazing!
Most helpful comment
@donnieflorence I just done it like this:
import "prismjs"
import "prismjs/components/prism-typescript"