mirror of
https://github.com/bobwen-dev/react-templates
synced 2025-04-12 00:56:39 +02:00
Merge remote-tracking branch 'origin/gh-pages' into gh-pages
This commit is contained in:
commit
a9536edce6
@ -25,6 +25,8 @@ https://github.com/wix/generator-react-templates
|
|||||||
Here's a sample Hello project:<br/>
|
Here's a sample Hello project:<br/>
|
||||||
https://github.com/wix/hello-react-templates
|
https://github.com/wix/hello-react-templates
|
||||||
|
|
||||||
|
## IntelliJ / WebStorm plugin
|
||||||
|
http://plugins.jetbrains.com/plugin/7648
|
||||||
|
|
||||||
|
|
||||||
###### Basic concepts for React templates
|
###### Basic concepts for React templates
|
||||||
|
@ -349,7 +349,7 @@ function convertHtmlToReact(node, context) {
|
|||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
function convertTemplateToReact(html, options) {
|
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);
|
options = _.defaults({}, options, defaultOptions);
|
||||||
var defines = {'react/addons': 'React', lodash: '_'};
|
var defines = {'react/addons': 'React', lodash: '_'};
|
||||||
var context = defaultContext(html, options);
|
var context = defaultContext(html, options);
|
||||||
|
5
test/data/inputs.rt
Normal file
5
test/data/inputs.rt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<!doctype rt>
|
||||||
|
<div>
|
||||||
|
<input type="text" name="first">
|
||||||
|
<input type="text" name="second">
|
||||||
|
</div>
|
15
test/data/inputs.rt.js
Normal file
15
test/data/inputs.rt.js
Normal file
@ -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'
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
});
|
@ -43,7 +43,7 @@ function errorEqual(err) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test('conversion test', function (t) {
|
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);
|
t.plan(files.length);
|
||||||
|
|
||||||
files.forEach(check);
|
files.forEach(check);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user