Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
node_modules
build
temp
.DS_Store
*.sublime-project
*.sublime-workspace
3 changes: 0 additions & 3 deletions src/htmltojsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ var HTMLtoJSX = function(config) {
if (!this.config.indent) {
this.config.indent = ' ';
}
if (!this.config.outputClassName) {
this.config.outputClassName = 'NewComponent';
}
};
HTMLtoJSX.prototype = {
/**
Expand Down
17 changes: 17 additions & 0 deletions test/htmltojsx-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,23 @@ describe('htmltojsx', function() {
);
});

it('should create a new React without var name', function() {
var converter = new HTMLtoJSX({
createClass: true
});
var result = converter.convert('<div>Hello world!</div>');
expect(result).toBe(
'React.createClass({\n' +
' render: function() {\n' +
' return (\n' +
'\n' +
' <div>Hello world!</div>\n' +
' );\n' +
' }\n' +
'});'
);
});

it('should wrap HTML with a div when multiple top-level', function() {
var converter = new HTMLtoJSX({
createClass: true,
Expand Down
⌂ Proxy