Skip to content

Commit

Permalink
feat(syntax-highlighter): support classname (#52)
Browse files Browse the repository at this point in the history
* feat(syntax-highlighter): support classname

* test: fixing a broken test

Co-authored-by: Jon Ursenbach <jon@ursenba.ch>
  • Loading branch information
runnabro and erunion authored Dec 5, 2020
1 parent e67afd5 commit d5ae061
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const SyntaxHighlighter = (
lang,
opts = {
// If `customTheme` is present, it will override the `dark` option.
className: '',
customTheme: false,
dark: false,
tokenizeVariables: false,
Expand All @@ -32,6 +33,10 @@ const SyntaxHighlighter = (
}

const classes = [`cm-s-${theme}`];
if (opts.className) {
classes.push(opts.className);
}

if (opts.highlightMode) {
classes.push('CodeEditor');
}
Expand Down

0 comments on commit d5ae061

Please sign in to comment.