seebrown/json2html — pull request #3 by bazineta (2013-02-03 23:07:59+00:00)
Title: Minor JSHint-suggested changes; addition of 'replace' option.

I was thrilled to find this excellent plugin; so elegant and intuitive as compared to the other options available. Thanks for making it available.

This pull request contains the following:

- JSHint-suggested changes, principally the usual semicolon additions, reduction of two-case switch statements to if/else, etc. However, there's one significant change in the first-level apply function, which had an apparent inadvertent global i var. In that it didn't appear to be doing anything, seemed safe to remove it entirely and simplify the function. Additionally, the regex contained a couple of unescaped characters.

- Addtion of a 'replace' option to the prepend and append options. Quite handy when, for example, replacing a given table row.

- Use of jQuery 1.9.0 and the jQuery migrate plugin in the test script to ensure no use of deprecated function.

- Finally, in the tokenizer, it would appear that onEnd and onFound, which aren't otherwise present and thus inadvertent globals, were perhaps leftovers. I've modified the call to use doBuild instead, which seems to be the right thing, but I'm frankly unsure on this one.

This now has a clean JSHint output, which I find helpful in development. Hope you find this useful.