Browse Source

highlight code blocks in excerpt too

Artur Paikin 5 years ago
parent
commit
ed01291b26
1 changed files with 2 additions and 0 deletions
  1. 2 0
      website/scripts/highlight.js

+ 2 - 0
website/scripts/highlight.js

@@ -31,6 +31,8 @@ function highlight (lang, code) {
 function prismify (data) {
   data.content = data.content.replace(unhighlightedCodeRx,
     (_, lang, code) => highlight(lang, entities.decode(code)))
+  data.excerpt = data.excerpt.replace(unhighlightedCodeRx,
+    (_, lang, code) => highlight(lang, entities.decode(code)))
 
   return data
 }