highlight code with highlight.js
This commit is contained in:
parent
5e7cfcf0cb
commit
e26074d01f
3 changed files with 16 additions and 4 deletions
14
src/App.js
14
src/App.js
|
|
@ -1,12 +1,13 @@
|
|||
import React, { Component } from 'react';
|
||||
import hljs from 'highlight.js';
|
||||
import 'highlight.js/styles/github-gist.css';
|
||||
|
||||
import { Container, Row, Column } from './skeleton';
|
||||
|
||||
import { Header } from './Header';
|
||||
import { Footer } from './Footer';
|
||||
|
||||
import { NavList, TagNav, HistoryNav } from './Nav';
|
||||
import { Article } from './Article';
|
||||
import { Footer } from './Footer';
|
||||
import { Header } from './Header';
|
||||
import { NavList, TagNav, HistoryNav } from './Nav';
|
||||
|
||||
|
||||
class App extends Component {
|
||||
|
|
@ -49,6 +50,11 @@ class App extends Component {
|
|||
/>
|
||||
];
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
// Auto-highlight all <pre><code> blocks
|
||||
hljs.initHighlightingOnLoad();
|
||||
}
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue