Prism: PrismJS default theme not highlighting on some languages

Created on 5 Jan 2017  路  4Comments  路  Source: PrismJS/prism

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?

Most helpful comment

@donnieflorence I just done it like this:
import "prismjs"
import "prismjs/components/prism-typescript"

All 4 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markerikson picture markerikson  路  3Comments

apollolux picture apollolux  路  4Comments

jaune162 picture jaune162  路  6Comments

timgoeller picture timgoeller  路  4Comments

neginbasiri picture neginbasiri  路  8Comments