Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More languages for highlighing #7

Closed
Radivarig opened this issue Jul 15, 2016 · 1 comment
Closed

More languages for highlighing #7

Radivarig opened this issue Jul 15, 2016 · 1 comment

Comments

@Radivarig
Copy link

Changing const decorator = new PrismDecorator({ defaultSyntax: 'language' }) works for few language definitions included in prismjs, as mentioned in this prism ticket
[ 'extend', 'insertBefore', 'DFS', 'markup', 'css', 'clike', 'javascript' ]
and for the other ones from languages-list it gives Error: Cannot read property 'rest' of undefined.

Mentioned in the same prism ticket there is a wrapper called prism-languages that provides a full list.

Could it be added to draft-js-prism?

@danielfarrell
Copy link

You just have to load the language file from prism first. For example, I have this at the top of my editor file:

import 'prismjs';
import 'prismjs/components/prism-markdown';

Each of the language components registers itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants