{"_id":"htmlparser-to-html","_rev":"2169180","name":"htmlparser-to-html","description":"Converts the JSON that the htmlparser/htmlparser2 package produces back to HTML.","dist-tags":{"latest":"0.0.6"},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"time":{"modified":"2022-01-05T02:57:23.000Z","created":"2013-04-06T03:17:13.367Z","0.0.6":"2017-01-05T02:56:14.036Z","0.0.5":"2013-07-29T18:20:45.747Z","0.0.4":"2013-06-07T21:23:20.893Z","0.0.3":"2013-05-03T00:26:55.510Z","0.0.2":"2013-04-12T02:39:13.586Z","0.0.1":"2013-04-09T01:29:05.647Z","0.0.0":"2013-04-06T03:17:13.367Z"},"users":{"uniquerockrz":true},"author":{"name":"Mikito Takada","email":"mikito.takada@gmail.com"},"repository":{"type":"git","url":"git://github.com/mixu/htmlparser-to-html.git"},"versions":{"0.0.6":{"name":"htmlparser-to-html","version":"0.0.6","description":"Converts the JSON that the htmlparser/htmlparser2 package produces back to HTML.","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/mixu/htmlparser-to-html.git"},"keywords":["html","parser","htmlparser","htmlparser2"],"author":{"name":"Mikito Takada","email":"mikito.takada@gmail.com"},"license":"BSD-3-Clause","devDependencies":{"mocha":"~1.9.0","htmlparser":"~1.7.6"},"gitHead":"0dc2ba249b0c810c2386ac5f717bd8464453baa8","bugs":{"url":"https://github.com/mixu/htmlparser-to-html/issues"},"homepage":"https://github.com/mixu/htmlparser-to-html#readme","_id":"htmlparser-to-html@0.0.6","_shasum":"93c56a390186812935a6a991a83131a67120d526","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"mixu","email":"mixu@mixu.net"},"dist":{"shasum":"93c56a390186812935a6a991a83131a67120d526","size":2310,"noattachment":false,"key":"/htmlparser-to-html/-/htmlparser-to-html-0.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/htmlparser-to-html/download/htmlparser-to-html-0.0.6.tgz"},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/htmlparser-to-html-0.0.6.tgz_1483584973788_0.9072487247176468"},"directories":{},"publish_time":1483584974036,"_cnpm_publish_time":1483584974036,"_hasShrinkwrap":false},"0.0.5":{"name":"htmlparser-to-html","version":"0.0.5","description":"Converts the JSON that the htmlparser/htmlparser2 package produces back to HTML.","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/mixu/htmlparser-to-html.git"},"keywords":["html","parser","htmlparser","htmlparser2"],"author":{"name":"Mikito Takada","email":"mikito.takada@gmail.com"},"license":"BSD","readmeFilename":"readme.md","devDependencies":{"mocha":"~1.9.0","htmlparser":"~1.7.6"},"bugs":{"url":"https://github.com/mixu/htmlparser-to-html/issues"},"_id":"htmlparser-to-html@0.0.5","dist":{"shasum":"bf3732f3b2fedbf88b79e87fe14bdf280c76ed9e","size":2092,"noattachment":false,"key":"/htmlparser-to-html/-/htmlparser-to-html-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/htmlparser-to-html/download/htmlparser-to-html-0.0.5.tgz"},"_from":".","_npmVersion":"1.3.1","_npmUser":{"name":"mixu","email":"mixu@mixu.net"},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"directories":{},"publish_time":1375122045747,"_cnpm_publish_time":1375122045747,"_hasShrinkwrap":false},"0.0.4":{"name":"htmlparser-to-html","version":"0.0.4","description":"Converts the JSON that the htmlparser/htmlparser2 package produces back to HTML.","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/mixu/htmlparser-to-html.git"},"keywords":["html","parser","htmlparser","htmlparser2"],"author":{"name":"Mikito Takada","email":"mikito.takada@gmail.com"},"license":"BSD","readmeFilename":"readme.md","devDependencies":{"mocha":"~1.9.0","htmlparser":"~1.7.6"},"_id":"htmlparser-to-html@0.0.4","dist":{"shasum":"03d3a261f1604beb7d321432cc175bcc0bace357","size":2119,"noattachment":false,"key":"/htmlparser-to-html/-/htmlparser-to-html-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/htmlparser-to-html/download/htmlparser-to-html-0.0.4.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"mixu","email":"mixu@mixu.net"},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"directories":{},"publish_time":1370640200893,"_cnpm_publish_time":1370640200893,"_hasShrinkwrap":false},"0.0.3":{"name":"htmlparser-to-html","version":"0.0.3","description":"Converts the JSON that the htmlparser/htmlparser2 package produces back to HTML.","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/mixu/htmlparser-to-html.git"},"keywords":["html","parser","htmlparser","htmlparser2"],"author":{"name":"Mikito Takada","email":"mikito.takada@gmail.com"},"license":"BSD","readmeFilename":"readme.md","devDependencies":{"mocha":"~1.9.0","htmlparser":"~1.7.6"},"_id":"htmlparser-to-html@0.0.3","dist":{"shasum":"7c85f257e931fc9731540144280e7c513542eb74","size":4281,"noattachment":false,"key":"/htmlparser-to-html/-/htmlparser-to-html-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/htmlparser-to-html/download/htmlparser-to-html-0.0.3.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"mixu","email":"mixu@mixu.net"},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"directories":{},"publish_time":1367540815510,"_cnpm_publish_time":1367540815510,"_hasShrinkwrap":false},"0.0.2":{"name":"htmlparser-to-html","version":"0.0.2","description":"Converts the JSON that the htmlparser/htmlparser2 package produces back to HTML.","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/mixu/htmlparser-to-html.git"},"keywords":["html","parser","htmlparser","htmlparser2"],"author":{"name":"Mikito Takada","email":"mikito.takada@gmail.com"},"license":"BSD","readmeFilename":"readme.md","devDependencies":{"mocha":"~1.9.0","htmlparser":"~1.7.6"},"_id":"htmlparser-to-html@0.0.2","dist":{"shasum":"aab5b111e9b27d75380dea042a26e438d88d48ca","size":3733,"noattachment":false,"key":"/htmlparser-to-html/-/htmlparser-to-html-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/htmlparser-to-html/download/htmlparser-to-html-0.0.2.tgz"},"_npmVersion":"1.1.63","_npmUser":{"name":"mixu","email":"mixu@mixu.net"},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"directories":{},"publish_time":1365734353586,"_cnpm_publish_time":1365734353586,"_hasShrinkwrap":false},"0.0.1":{"name":"htmlparser-to-html","version":"0.0.1","description":"Converts the JSON that the htmlparser/htmlparser2 package produces back to HTML.","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/mixu/htmlparser-to-html.git"},"keywords":["html","parser","htmlparser","htmlparser2"],"author":{"name":"Mikito Takada","email":"mikito.takada@gmail.com"},"license":"BSD","readmeFilename":"readme.md","devDependencies":{"mocha":"~1.9.0","htmlparser":"~1.7.6"},"_id":"htmlparser-to-html@0.0.1","dist":{"shasum":"83d6cf51602bc58cbe09c670a227fb1a09aa6626","size":3472,"noattachment":false,"key":"/htmlparser-to-html/-/htmlparser-to-html-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/htmlparser-to-html/download/htmlparser-to-html-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"mixu","email":"mixu@mixu.net"},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"directories":{},"publish_time":1365470945647,"_cnpm_publish_time":1365470945647,"_hasShrinkwrap":false},"0.0.0":{"name":"htmlparser-to-html","version":"0.0.0","description":"Converts the JSON that the htmlparser/htmlparser2 package produces back to HTML.","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/mixu/htmlparser-to-html.git"},"keywords":["html","parser","htmlparser","htmlparser2"],"author":{"name":"Mikito Takada","email":"mikito.takada@gmail.com"},"license":"BSD","readmeFilename":"readme.md","devDependencies":{"mocha":"~1.9.0","htmlparser":"~1.7.6"},"_id":"htmlparser-to-html@0.0.0","dist":{"shasum":"c18843bd2dfe68cb629b77b7a392d7d194b17460","size":3450,"noattachment":false,"key":"/htmlparser-to-html/-/htmlparser-to-html-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/htmlparser-to-html/download/htmlparser-to-html-0.0.0.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"mixu","email":"mixu@mixu.net"},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"directories":{},"publish_time":1365218233367,"_cnpm_publish_time":1365218233367,"_hasShrinkwrap":false}},"readme":"# htmlparser-to-html\n\nConverts the JSON that [htmlparser](https://npmjs.org/package/htmlparser) (and probably [htmlparser2](https://npmjs.org/package/htmlparser2)) produces back to HTML.\n\nUseful if you're doing some sort of transformation.\n\nTests are based on reversing the parser tests in htmlparser, so they are quite comprehensive.\n\n## API\n\nReturns a single function `html(tree, [parent, mapFn])` which returns a html string.\n\nOptionally, you can apply a function to each element just before they are converted to HTML - for example, converting items that are not in the right format into htmlparser-compatible input.\n\n- `tree`: a tree structure produced by htmlparser\n- `parent`: optional param - a parent element, only used for the `mapFn`.\n- `mapFn`: a function(item, parent) that is applied to each element just before the element is converted into html. The parent parameter is either the original value of the parent (default: null), or the parent element of this child element.\n\n### Configuration\nhtmlparser-to-html can be configured with the `configure(config_object)`. The following configuration parmeters are available:\n\n- `disableAttribEscape`: Set to `true` to disable escaping the attribute values. (default is `false`)\n\n\n## Usage\n\n    var html = require('htmlparser-to-html');\n\n    console.log(html([\n            {   type: 'tag'\n              , name: 'html'\n              , children:\n                 [ { type: 'tag'\n                   , name: 'title'\n                   , children: [ { data: 'The Title', type: 'text' } ]\n                   }\n                 , { type: 'tag'\n                   , name: 'body'\n                   , children: [ { data: 'Hello world', type: 'text' } ]\n                   }\n                 ]\n              }\n            ]));\n\n    // outputs: <html><title>The Title</title><body>Hello world</body></html>\n\nOf course, you probably want to generate the array from htmlparser.\n\n### Example configuration\n    var html = require('htmlparser-to-html');\n\n    html.configure({disableAttribEscape: true);\n\n\n","_attachments":{},"homepage":"https://github.com/mixu/htmlparser-to-html#readme","bugs":{"url":"https://github.com/mixu/htmlparser-to-html/issues"},"license":"BSD-3-Clause"}