{"name":"@mapbox/hast-util-to-jsx","version":"2.0.0","description":"Transform HAST to JSX","main":"index.js","repository":{"type":"git","url":"git+https://github.com/mapbox/jsxtreme-markdown.git"},"author":{"name":"Mapbox"},"license":"MIT","bugs":{"url":"https://github.com/mapbox/jsxtreme-markdown/issues"},"homepage":"https://github.com/mapbox/jsxtreme-markdown/tree/main/packages/hast-util-to-jsx#readme","keywords":["hast","plugin","markdown","html","react","jsx","transform"],"dependencies":{"kebab-case":"^1.0.0","postcss":"^7.0.39","postcss-js":"^2.0.3","property-information":"^5.5.0","react-attr-converter":"^0.3.1","stringify-entities":"^3.0.1","stringify-object":"^3.3.0"},"devDependencies":{"hastscript":"^5.1.2","rehype-parse":"^6.0.2","unified":"^9.2.2","unist-builder":"^2.0.3"},"engines":{"node":">=14"},"gitHead":"5c0cb3bbe07fede8b415203b43139584d1737c31","_id":"@mapbox/hast-util-to-jsx@2.0.0","_nodeVersion":"14.15.4","_npmVersion":"lerna/3.22.1/node@v14.15.4+x64 (darwin)","dist":{"integrity":"sha512-o+2fGJo3xdqHOw3Y4hioS1qg/Bjh6NR80cJToTBRx682gLs1rttyyJTpYwi+AWFajPNaVxymGDnwYOmVqAAZSA==","shasum":"17b25cca42015d8d3f6f241de4f068f36975a6e7","tarball":"http://registry-npm.ywwl.com/@mapbox/hast-util-to-jsx/download/@mapbox/hast-util-to-jsx-2.0.0.tgz","fileCount":13,"unpackedSize":29250,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnkP2CRA9TVsSAnZWagAAGIUP/3WrVSAobyMEe5nTX+ls\nMy7g1kpRLU0YGtoWzWjr+p0b3awYHWtLeHb1v/n93lbgDJjsvOf3k968XECh\n188sfUzS5vx0zTQqCZyLRbGKzQ3Fg0vASH44ZDC1pURp3cS52RR/Mh4ANho0\nJWdjSZ/mr3ydZ9HrkFREWGRKZtAy6cCdV2LjBHrg2CyeQK3VOKziJeQjI5uF\nCqLqQRpenBh8oC+38Z0iCR5BAcPAVpmvAX2WWsC3BUfM/BBRCW4az7gwE7sY\nAGKDf3IK932PGGQwXSnzLcD9QShFTCAjXCF6OCOrL2oE3V8tmlOESilcNvWy\n/RUyAG4lbOgv6Xpos6Jx6rHA34f0PwJjeH/F2nIwbATPlPJw16/WuGh+0v4R\nrshK5B4bgXB9sqdO8buoOBsTM9c1RQSZa6y7WT6nFo0FyWKmd2wzlGhH3hZ8\n18j1RLq8aJ+pJVr94riHFM2FlWnRH9rTRFchTU0HRTFnN9KWnIwYZA/wDZ7o\n9x7L17GcDjGrW4P2Z4h3KTCJhfpBowHSfNsfDLcifJgOBAYuCMonnqKdqMHt\naMrq7g3/yfLOeGnpNFaTRNrfbZA6NKpY0xOiMs5NpQjPNLsmxtkSCM0mlC6r\nBk5HR51qDZ1dN/VbPO2+HMOCFrP5Q2zR4ts1Qa3xXcacgxXdOyFs0wtZheIB\nXoVs\r\n=xXBz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjySjjCyzIm9vNr8jr4S/Jhd0A1tRscf03NqWQJ2C2ZgIgXW00glPCN25WqSgZqTtv5zkRtiXj0oMGf8eH6/O3Vfk="}],"size":8087,"noattachment":false,"key":"/@mapbox/hast-util-to-jsx/-/@mapbox/hast-util-to-jsx-2.0.0.tgz"},"_npmUser":{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},"directories":{},"maintainers":[{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hast-util-to-jsx_2.0.0_1637762038225_0.18431252147554278"},"_hasShrinkwrap":false,"readme":"# @mapbox/hast-util-to-jsx\n\nTransform [HAST](https://github.com/syntax-tree/hast) to JSX.\n\n## Installation\n\n```\nnpm install @mapbox/hast-util-to-jsx\n```\n\n## Usage\n\n```js\nconst h = require('hyperscript');\nconst toJsx = require('@mapbox/hast-util-to-jsx');\n\nconst tree = h('div.one.two', id: 'bar' }, [\n  h('p.hidden', { ariaHidden: true }, ['hidden text']),\n  h('p', { style: 'color: pink; font-size: 2em;' }, ['fancy text'])\n]);\n\nconsole.log(toJsx(tree));\n```\n\nYields (with whitespace collapsed):\n\n```jsx\n<div className=\"one two\" id=\"bar\">\n  <p className=\"hidden\" aria-hidden={true}>hidden text</p>\n  <p style={{color: \"pink\", fontSize: \"2em\"}}>fancy text</p>\n</div>\n```\n\nA few libraries exist to transform HTML to JSX.\nUsing this util, you can perform that transformation entirely within the ecosystem of [`unified`](https://github.com/unifiedjs/unified) syntax trees, using [`rehype`](https://github.com/rehypejs/rehype) to parse HTML and this util to stringify the tree into JSX.\n\n## Related\n\n- [`hast-util-to-html`](https://github.com/syntax-tree/hast-util-to-html) — Transform HAST to HTML.\n- [`rehype`](https://github.com/rehypejs/rehype) — Process HTML as HAST.\n","publish_time":1637762038348,"_cnpm_publish_time":1637762038348,"dist-tags":{"latest":"2.1.0"}}