mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-11 18:32:50 +00:00
beautified
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
import hljs from 'highlight.js';
|
||||
import marked from 'marked';
|
||||
import React from 'react';
|
||||
import {Link} from 'react-router';
|
||||
import marked from 'marked';
|
||||
import hljs from 'highlight.js';
|
||||
|
||||
import '../../assets/scss/Content.scss';
|
||||
|
||||
const renderer = new marked.Renderer();
|
||||
|
||||
marked.setOptions({
|
||||
langPrefix: 'hljs ',
|
||||
highlight: (code) => {
|
||||
return hljs.highlightAuto(code).value;
|
||||
}
|
||||
langPrefix: 'hljs ',
|
||||
highlight: (code) => {
|
||||
return hljs.highlightAuto(code).value;
|
||||
}
|
||||
});
|
||||
|
||||
export default class Post extends React.Component{
|
||||
export default class Post extends React.Component {
|
||||
|
||||
render(){
|
||||
return(
|
||||
render() {
|
||||
return (
|
||||
<div class="Content">
|
||||
<div dangerouslySetInnerHTML={{__html : marked(this.props.content, {renderer : renderer})}}>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user