Closed Radivarig closed 7 years ago
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.
Changing
const decorator = new PrismDecorator({ defaultSyntax: 'language' })
works for fewlanguage
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 givesError: 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
?