{"name":"simple-html-tokenizer","version":"0.2.2","license":"MIT","description":"Simple HTML Tokenizer is a lightweight JavaScript library that can be used to tokenize the kind of HTML normally found in templates.","keywords":["html","tokenizer"],"repository":{"type":"git","url":"git+https://github.com/tildeio/simple-html-tokenizer.git"},"main":"dist/simple-html-tokenizer.js","jsnext:main":"lib/simple-html-tokenizer.js","scripts":{"build":"bin/build.js","prepublish":"npm run build","test":"testem ci","lint":"jshint bin lib test"},"devDependencies":{"jshint":"^2.8.0","qunit-extras":"^1.4.2","qunitjs":"^1.18.0","rollup":"^0.14.1","testem":"^0.9.2"},"gitHead":"28f3fa3eb9bb6385557b72ef0d82b1c56b60cbaa","bugs":{"url":"https://github.com/tildeio/simple-html-tokenizer/issues"},"homepage":"https://github.com/tildeio/simple-html-tokenizer#readme","_id":"simple-html-tokenizer@0.2.2","_shasum":"ae57bd355fe704af842c4f116a8af78c5cac93cc","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"rwjblue","email":"me@rwjblue.com"},"dist":{"shasum":"ae57bd355fe704af842c4f116a8af78c5cac93cc","tarball":"http://registry-npm.ywwl.com/simple-html-tokenizer/download/simple-html-tokenizer-0.2.2.tgz","integrity":"sha512-EzxiM1xDKESvplE/Tpe47kFCO6415kDrPSZbHTQRhlDzY93z2ssb0phttbxuImC2ALxKmojHP8HBIRTzBS+vHQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEdKNniV/e4KloCK53ZEUrPPyKy8ih5dBErBiJCcl6JEAiEA03KaLjJWKZRwNqJRbiv69cMGvG4UXHzPA+rlSxCfGpY="}],"size":52858,"noattachment":false,"key":"/simple-html-tokenizer/-/simple-html-tokenizer-0.2.2.tgz"},"maintainers":[{"name":"chancancode","email":"godfreykfc@gmail.com"},{"name":"krisselden","email":"kris.selden@gmail.com"},{"name":"rwjblue","email":"me@rwjblue.com"},{"name":"stefanpenner","email":"stefan.penner@gmail.com"},{"name":"wycats","email":"wycats@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/simple-html-tokenizer-0.2.2.tgz_1462376348793_0.8018436094280332"},"directories":{},"readme":"# Simple HTML Tokenizer [![Build Status](![CI](https://github.com/tildeio/simple-html-tokenizer/workflows/CI/badge.svg))](https://github.com/tildeio/simple-html-tokenizer/actions?query=workflow%3ACI)\n\nSimple HTML Tokenizer is a lightweight JavaScript library that can be\nused to tokenize the kind of HTML normally found in templates. It can be\nused to preprocess templates to change the behavior of some template\nelement depending upon whether the template element was found in an\nattribute or text.\n\nIt is not a full HTML5 tokenizer. It focuses on the kind of HTML that is\nused in templates: content designed to be inserted into the `<body>`\nand without `<script>` tags.\n\nIn particular, Simple HTML Tokenizer does not handle many states from\nthe [HTML5 Tokenizer Specification][1]:\n\n* Any states involving `CDATA` or `RCDATA`\n* Any states involving `<script>`\n* Any states involving `<DOCTYPE>`\n* The bogus comment state\n\nIt also passes through character references, instead of trying to\ntokenize and process them, because the preprocessed templates will\nultimately be parsed by a real browser context.\n\nAt the moment, there are some error states specified by the tokenizer\nspec that are not handled by Simple HTML Tokenizer. Ultimately, I plan\nto support all error states, as well as provide information about\ntokenizer errors in debug mode.\n\n[1]: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html\n\n# Usage\n\nYou can tokenize HTML:\n\n```js\nvar tokens = HTML5Tokenizer.tokenize(\"<div id='foo' href=bar class=\\\"bat\\\">\");\n\nvar token = tokens[0];\ntoken.tagName     //=> \"div\"\ntoken.attributes  //=> [[\"id\", \"foo\"], [\"href\", \"bar\"], [\"class\", \"bat\"]]\ntoken.selfClosing //=> false\n```\n\n## Building and running the tests\n\n```bash\nnpm install\nnpm test\n```\n","publish_time":1462376349252,"_cnpm_publish_time":1462376349252,"dist-tags":{"latest":"1.0.0"}}