Good to know! I'm currently on vacation but I'll look at adding a simple
command-line version to react-tools once I'm back and get some free time.

Sent from my mobile.
On Dec 29, 2013 4:03 PM, "jhiswin" <notifications@github.com> wrote:

> In docs/_js/html-jsx-lib.js:
>
> > +    reset: function() {
> > +      this.output = '';
> > +      this.level = 0;
> > +    },
> > +    /**
> > +     * Main entry point to the converter. Given the specified HTML, returns a
> > +     * JSX object representing it.
> > +     * @param {string} html HTML to convert
> > +     * @return {string} JSX
> > +     */
> > +    convert: function(html) {
> > +      this.reset();
> > +
> > +      // It turns out browsers have good HTML parsers (imagine that).
> > +      // Let's take advantage of it.
> > +      var containerEl = document.createElement('div');
>
> Just want to mention it works with jsdom as is:
>
> var fs = require("fs");
> var jsdom = require("jsdom");
>
> var htmljsx = fs.readFileSync("./html-jsx-lib.js","utf-8");
>
> jsdom.env({
> url:"http://sip1.idiil.org/",
> src: [htmljsx],
> done: function(errors,window){
>       HTMLtoJSX = window.HTMLtoJSX;
>       var converter = new HTMLtoJSX({
>         outputClassName: "MyClass",
>         createClass: true
>       });
>       console.log(converter.convert("<!doctype html><html></head><body><p><input></p></body></html>"));
> }
> });
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/facebook/react/pull/667/files#r8579909>
> .
>