bugfix: syntax highlighting
This commit is contained in:
parent
3a9d6117bb
commit
0992ce6a85
14
register.js
14
register.js
|
@ -34,20 +34,14 @@ var pretty = _interopRequireWildcard(_pretty);
|
|||
|
||||
var _reactSyntaxHighlighter = require('react-syntax-highlighter');
|
||||
|
||||
var _javascript = require('react-syntax-highlighter/languages/hljs/javascript');
|
||||
var _reactSyntaxHighlighter2 = _interopRequireDefault(_reactSyntaxHighlighter);
|
||||
|
||||
var _javascript2 = _interopRequireDefault(_javascript);
|
||||
|
||||
var _docco = require('react-syntax-highlighter/dist/styles/hljs/docco');
|
||||
|
||||
var _docco2 = _interopRequireDefault(_docco);
|
||||
var _hljs = require('react-syntax-highlighter/dist/styles/hljs');
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
Light.registerLanguage('javascript', _javascript2.default);
|
||||
|
||||
var styles = {
|
||||
markupPanel: {
|
||||
margin: 10,
|
||||
|
@ -115,8 +109,8 @@ var StaticMarkup = function (_React$Component) {
|
|||
active = _props$active === undefined ? true : _props$active;
|
||||
|
||||
return active ? _react2.default.createElement(
|
||||
_reactSyntaxHighlighter.Light,
|
||||
{ language: 'html', style: _docco2.default },
|
||||
_reactSyntaxHighlighter2.default,
|
||||
{ language: 'html', style: _hljs.docco },
|
||||
pretty(markup)
|
||||
) : null;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
import React from 'react';
|
||||
import addons from '@storybook/addons';
|
||||
import * as pretty from 'pretty';
|
||||
|
||||
import { Light as SyntaxHighlighter } from "react-syntax-highlighter";
|
||||
import js from 'react-syntax-highlighter/languages/hljs/javascript';
|
||||
import docco from 'react-syntax-highlighter/dist/styles/hljs/docco';
|
||||
Light.registerLanguage('javascript', js);
|
||||
import SyntaxHighlighter from 'react-syntax-highlighter';
|
||||
import { docco } from 'react-syntax-highlighter/dist/styles/hljs';
|
||||
|
||||
const styles = {
|
||||
markupPanel: {
|
||||
|
|
Loading…
Reference in a new issue