diff --git a/.gitignore b/.gitignore index 57510a2..bbc0c0a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ _site/ +/node_modules diff --git a/lib/diffDecorator.js b/lib/diffDecorator.js index 87ba755..cff1d6c 100644 --- a/lib/diffDecorator.js +++ b/lib/diffDecorator.js @@ -23,17 +23,30 @@ function diffDecorator(strategies) { } // Decorators +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; -var InsertSpan = function (props) { - return {props.children}; +var InsertSpan = function InsertSpan(props) { + return React.createElement( + "span", + _extends({}, props, { className: "diff-insert" }), + props.children + ); }; -var EqualSpan = function (props) { - return {props.children}; +var EqualSpan = function EqualSpan(props) { + return React.createElement( + "span", + _extends({}, props, { className: "diff-equal" }), + props.children + ); }; -var DeleteSpan = function (props) { - return {props.children}; +var DeleteSpan = function DeleteSpan(props) { + return React.createElement( + "span", + _extends({}, props, { className: "diff-delete" }), + props.children + ); }; module.exports = diffDecorator; diff --git a/lib/diffEditor.js b/lib/diffEditor.js index ef60a8d..f54adf7 100644 --- a/lib/diffEditor.js +++ b/lib/diffEditor.js @@ -149,30 +149,36 @@ var DiffEditor = React.createClass({ render: function () { var before; if (!this.props.before.hidden) { - before =