diff --git a/README.md b/README.md index cde89ae..1a81be5 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ https://github.com/wix/generator-react-templates Here's a sample Hello project:
https://github.com/wix/hello-react-templates +## IntelliJ / WebStorm plugin +http://plugins.jetbrains.com/plugin/7648 ###### Basic concepts for React templates diff --git a/src/reactTemplates.js b/src/reactTemplates.js index c372830..3aec3b3 100644 --- a/src/reactTemplates.js +++ b/src/reactTemplates.js @@ -349,7 +349,7 @@ function convertHtmlToReact(node, context) { * @return {string} */ function convertTemplateToReact(html, options) { - var rootNode = cheerio.load(html, {lowerCaseTags: false, lowerCaseAttributeNames: false, xmlMode: true, withStartIndices: true}); + var rootNode = cheerio.load(html, {lowerCaseTags: false, lowerCaseAttributeNames: false, xmlMode: false, withStartIndices: true}); options = _.defaults({}, options, defaultOptions); var defines = {'react/addons': 'React', lodash: '_'}; var context = defaultContext(html, options); diff --git a/test/data/inputs.rt b/test/data/inputs.rt new file mode 100644 index 0000000..2458690 --- /dev/null +++ b/test/data/inputs.rt @@ -0,0 +1,5 @@ + +
+ + +
diff --git a/test/data/inputs.rt.js b/test/data/inputs.rt.js new file mode 100644 index 0000000..e49380f --- /dev/null +++ b/test/data/inputs.rt.js @@ -0,0 +1,15 @@ +define([ + 'react/addons', + 'lodash' +], function (React, _) { + 'use strict'; + return function () { + return React.createElement('div', {}, React.createElement('input', { + 'type': 'text', + 'name': 'first' + }), React.createElement('input', { + 'type': 'text', + 'name': 'second' + })); + }; +}); diff --git a/test/src/test.js b/test/src/test.js index 6d9a627..c0f25ff 100644 --- a/test/src/test.js +++ b/test/src/test.js @@ -43,7 +43,7 @@ function errorEqual(err) { } test('conversion test', function (t) { - var files = ['div.rt', 'test.rt', 'repeat.rt']; + var files = ['div.rt', 'test.rt', 'repeat.rt','inputs.rt']; t.plan(files.length); files.forEach(check);