diff --git a/src/index.js b/src/index.js index 5bdf209..f802c38 100644 --- a/src/index.js +++ b/src/index.js @@ -16,4 +16,3 @@ module.exports = function loader(content) { .then(component => callback(null, component)) .catch(callback); }; - diff --git a/src/parser.js b/src/parser.js index 573982d..4e28292 100644 --- a/src/parser.js +++ b/src/parser.js @@ -3,7 +3,7 @@ const frontMatter = require('front-matter'); const Prism = require('node-prismjs'); const Remarkable = require('remarkable'); -const escapeHtml = require('remarkable/lib/common/utils').escapeHtml; +const { escapeHtml } = require('remarkable/lib/common/utils'); const md = new Remarkable(); diff --git a/test/examples/button.js b/test/examples/button.js index a4729d1..fa56122 100644 --- a/test/examples/button.js +++ b/test/examples/button.js @@ -6,8 +6,8 @@ import PropTypes from 'prop-types'; * @param {Object} props React props * @returns {JSX} template */ -export default function Button(props) { - return ; +export default function Button({ label }) { + return ; } Button.propTypes = { label: PropTypes.string }; diff --git a/test/examples/hello-world.js b/test/examples/hello-world.js index 6420690..56bd7a2 100644 --- a/test/examples/hello-world.js +++ b/test/examples/hello-world.js @@ -7,8 +7,13 @@ import PropTypes from 'prop-types'; * @param {Object} props React props * @returns {JSX} template */ -export default function HelloWorld(props) { - return
Hello { props.who }
; +export default function HelloWorld({ who }) { + return ( +
+ Hello + {who} +
+ ); } HelloWorld.propTypes = { who: PropTypes.string }; diff --git a/test/parser.spec.js b/test/parser.spec.js index 505a9ff..76acc11 100644 --- a/test/parser.spec.js +++ b/test/parser.spec.js @@ -47,21 +47,21 @@ describe('Parse Markdown', () => { `); }); - it('parses markdown with live code blocks', () => + it('parses markdown with live code blocks', () => ( parser.parse(mdExample).then((result) => { expect(result.html).toMatch(/
\s*