fix highlighting on posts and pages
This commit is contained in:
parent
7e838f31ec
commit
5a94ee35e6
3 changed files with 11 additions and 5 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import hljs from 'highlight.js';
|
||||
import React, { Component } from 'react';
|
||||
import Markdown from 'react-markdown';
|
||||
import slugify from 'slugify';
|
||||
|
|
@ -45,6 +46,9 @@ class Page extends Component {
|
|||
|
||||
componentDidMount() {
|
||||
this.fetchPage();
|
||||
document.querySelectorAll('pre code').forEach(elm => {
|
||||
hljs.highlightBlock(elm);
|
||||
});
|
||||
}
|
||||
|
||||
componentWillReceiveProps(props) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue