fix: highlightjs custom highlighting function(#1016)

* Added line for syntax definition #960

* chore: nits & fix for v2 as well
This commit is contained in:
Erik Sultanaliev 2018-10-05 13:59:24 +06:00 committed by Endilie Yacop Sucipto
parent bdbbfaee91
commit aae5c4dc85
3 changed files with 38 additions and 24 deletions

View file

@ -27,6 +27,11 @@ class MarkdownRenderer {
// This results in <pre><code class="hljs css languages-jsx">
langPrefix: 'hljs css language-',
highlight(str, lang) {
// User's own custom highlighting function
if (siteConfig.highlight && siteConfig.highlight.hljs) {
siteConfig.highlight.hljs(hljs);
}
// Fallback to default language
lang =
lang || (siteConfig.highlight && siteConfig.highlight.defaultLang);
if (lang === 'text') {