From c5c1b1339e02636c3714ebf8f9cc466bd3e98a70 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Thu, 24 Mar 2016 10:56:13 +0800 Subject: [PATCH] refactor: hightlight code in loader --- package.json | 2 +- site/component/Demo/index.jsx | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 6bc3fb8aa3..861b178cad 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "warning": "~2.1.0" }, "devDependencies": { - "antd-md-loader": "0.1.0-beta.13", + "antd-md-loader": "0.1.0-beta.14", "atool-build": "^0.5.0", "autoprefixer": "^6.3.3", "babel-cli": "^6.2.0", diff --git a/site/component/Demo/index.jsx b/site/component/Demo/index.jsx index 53636d0f84..002d42ff8f 100644 --- a/site/component/Demo/index.jsx +++ b/site/component/Demo/index.jsx @@ -2,7 +2,6 @@ import React from 'react'; import { Link } from 'react-router'; import { Collapse } from '../../../'; import * as utils from '../utils'; -import hljs from 'highlight.js'; export default class Demo extends React.Component { constructor(props) { @@ -21,10 +20,9 @@ export default class Demo extends React.Component { } render() { - const { id, meta, intro, code, preview, style, src, - expand, pathname } = this.props; + const { id, meta, intro, preview, style, src, + highlightedCode, highlightedStyle, expand, pathname } = this.props; const introChildren = intro.map(utils.objectToComponent.bind(null, pathname)); - const highlightedCode = hljs.highlight('javascript', code).value; return (
@@ -61,7 +59,7 @@ export default class Demo extends React.Component {
                       
                     
: