mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-13 17:17:28 +02:00
fix: highlightjs custom highlighting function(#1016)
* Added line for syntax definition #960 * chore: nits & fix for v2 as well
This commit is contained in:
parent
bdbbfaee91
commit
aae5c4dc85
3 changed files with 38 additions and 24 deletions
|
@ -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') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue