{"_id":"@astrojs/micromark-extension-mdx-jsx","_rev":"3-7f2f20977beee74f205a2e7fe9441a1a","name":"@astrojs/micromark-extension-mdx-jsx","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.3":{"name":"@astrojs/micromark-extension-mdx-jsx","version":"1.0.3","keywords":["micromark","micromark-extension","mdx","mdxjs","jsx","js","javascript","es","ecmascript","markdown","unified"],"author":{"name":"withastro"},"license":"MIT","_id":"@astrojs/micromark-extension-mdx-jsx@1.0.3","maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"},{"name":"drewpowers","email":"drew@pow.rs"},{"name":"fredkschott","email":"fkschott@gmail.com"},{"name":"matthewp","email":"matthew@matthewphillips.info"}],"contributors":[{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"}],"homepage":"https://astro.build","bugs":{"url":"https://github.com/withastro/micromark-extension-mdx-jsx/issues"},"dist":{"shasum":"539f7d4d512b510adbe0d83e1a7385a3f5c1387d","tarball":"https://registry.npmjs.org/@astrojs/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-1.0.3.tgz","fileCount":23,"integrity":"sha512-O15+i2DGG0qb1R/1SYbFXgOKDGbYdV8iJMtuboVb1S9YFQfMOJxaCMco0bhXQI7PmZcQ4pZWIjT5oZ64dXUtRA==","signatures":[{"sig":"MEQCIA8HaXgJ8CpEW5mn6xqrHg7QaH0ee6o3M8DLB5H4VmDlAiBEBtSekdk6ViRED5JFuGbNqNP8c6106/O91RhPyQckpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJin8RjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp8Dw/+O+bMM4aBrsX7F3zeVSTb3idZJouElX9PjB5pkIos5ACl8o+m\r\n8h6Gj5DjnB9n78NDd1Q79z1lSJCQ8Q2BmpfnGEKQXVR2UF/6CeIUWUa3pdP+\r\n71/z3Piyqf79VkYbOi790pfJdMfOO1S4gcjBoaYKLQugDJ1/QCnoPUUi7aaX\r\n1h6rdHtWorP6ww2JuD7xJIdfiUZyeBggQOTnHVHJOJ9LL5g8O+g89/Z1I56Z\r\niwqkg+OnNI6ZHCJb867hDwwSxz6GZWsM57Q2vCjBqhqdNLuvV9KP0vPXaKEy\r\nlrwdQ9cgTv38eA0Bf8NYgGtWrDrEYXPuPCgBbttR6bk/ffACCQT1zQbEaUtS\r\nkdIvJcsZ6T9RfdMbkMUPLNxJHj7DMb1VLP5bb8Gjn61T6BLmMHx2DOrb7I6J\r\nE91n2JqhcECcx9FuhB0ixSC4+1knbFien3h/j6jP4mxqytOh7vwArmHyIRJn\r\nSb5c5k0AJOxjOT0DEQbvAiaFSiL10QVDdkPEazo9my8odcN3KEUYEuHnAslX\r\na7KCGHPscfaBaiMlSOadj+y5VGacw2ucxsxJZrhEfFFdqGDGJSMaK7USUmKi\r\nWixVZLXgRn2GNw2lmDVchQFv8n5NFiN6S1uQ5FWC6r+DrkUyFy4XSWgVmTKC\r\nU/pXD9lAWL3YymDW8ry3EZ2SajakmvJLBgs=\r\n=kiNC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","type":"module","_from":"file:astrojs-micromark-extension-mdx-jsx-1.0.3.tgz","types":"index.d.ts","exports":{"default":"./index.js","development":"./dev/index.js"},"scripts":{"test":"npm run build && npm run test-coverage","build":"rimraf \"dev/**/*.d.ts\" \"script/**/*.d.ts\" \"test/**/*.d.ts\" && tsc && type-coverage && micromark-build && npm run format","format":"prettier ./index.{js,d.ts} ./lib -w --loglevel warn","test-api":"node --conditions development test/index.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node --conditions development test/index.js"},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"prettier":{"semi":false,"useTabs":false,"tabWidth":2,"singleQuote":true,"trailingComma":"none","bracketSpacing":false},"_resolved":"/tmp/9208df0053fd2e75a79eca9ecacc2c7e/astrojs-micromark-extension-mdx-jsx-1.0.3.tgz","_integrity":"sha512-O15+i2DGG0qb1R/1SYbFXgOKDGbYdV8iJMtuboVb1S9YFQfMOJxaCMco0bhXQI7PmZcQ4pZWIjT5oZ64dXUtRA==","repository":{"url":"git+https://github.com/withastro/micromark-extension-mdx-jsx.git","type":"git"},"_npmVersion":"8.5.5","description":"Less strict version of micromark-extension-mdx-jsx.","directories":{},"sideEffects":false,"_nodeVersion":"16.15.0","dependencies":{"uvu":"^0.5.0","@types/acorn":"^4.0.0","vfile-message":"^3.0.0","micromark-util-types":"^1.0.0","micromark-util-symbol":"^1.0.0","micromark-factory-space":"^1.0.0","micromark-util-character":"^1.0.0","estree-util-is-identifier-name":"^2.0.0","micromark-factory-mdx-expression":"^1.0.0"},"remarkConfig":{"plugins":["preset-wooorm","./script/grammar.js"]},"typeCoverage":{"detail":true,"strict":true,"atLeast":100,"ignoreCatch":true},"_hasShrinkwrap":false,"packageManager":"pnpm@7.0.1","devDependencies":{"c8":"^7.0.0","tape":"^5.0.0","acorn":"^8.0.0","eslint":"^8.17.0","rimraf":"^3.0.0","prettier":"^2.0.0","acorn-jsx":"^5.0.0","micromark":"^3.0.0","mdast-zone":"^5.0.0","remark-cli":"^10.0.0","typescript":"^4.0.0","@types/tape":"^4.0.0","@types/mdast":"^3.0.0","type-coverage":"^2.0.0","@changesets/cli":"^2.22.0","micromark-build":"^1.0.0","remark-preset-wooorm":"^9.0.0","@typescript-eslint/parser":"^5.27.1","@typescript-eslint/eslint-plugin":"^5.27.1"},"_npmOperationalInternal":{"tmp":"tmp/micromark-extension-mdx-jsx_1.0.3_1654637666785_0.5002422378079416","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-06-07T21:34:26.716Z","modified":"2025-09-18T17:31:56.093Z","1.0.3":"2022-06-07T21:34:26.980Z"},"bugs":{"url":"https://github.com/withastro/micromark-extension-mdx-jsx/issues"},"author":{"name":"withastro"},"license":"MIT","homepage":"https://astro.build","keywords":["micromark","micromark-extension","mdx","mdxjs","jsx","js","javascript","es","ecmascript","markdown","unified"],"repository":{"url":"git+https://github.com/withastro/micromark-extension-mdx-jsx.git","type":"git"},"description":"Less strict version of micromark-extension-mdx-jsx.","contributors":[{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"}],"maintainers":[{"email":"fkschott@gmail.com","name":"fredkschott"},{"email":"matthew@matthewphillips.info","name":"matthewp"}],"readme":"# [**@astrojs/micromark-extension-mdx-jsx**](https://github.com/astrojs/micromark-extension-mdx-jsx)\n\nThis fork is based on [micromark/micromark-extension-mdx-jsx](https://github.com/micromark/micromark-extension-mdx-jsx) by the original author [Titus Wormer](https://wooorm.com).\n\nThe purpose of this fork is to provide extended MDX/JSX syntax support for the [Astro](https://github.com/withastro/astro) website build tool. If you're not using Astro, you should probably use the original extension instead of this fork.\n\n## Syntax differences\n\n### Colons (`:`) preceded by whitespace start attribute names instead of local names\n\nThe original code always treated colons inside JSX tags as a separator between a primary name and a local name, even if there was whitespace before the colon. Our forked version starts an attribute name instead of a local name if there is whitespace before the colon.\n\nThis leads to the following changes:\n\n*   The syntax `<input :placeholder=\"...\">` is now treated as an `input` element with an attribute named `:placeholder`.\n    *   The original code treated this like `<input:placeholder=\"...\">`, resulting in an element named `input:placeholder` (with `placeholder` being the local name of the element), and a syntax error due to the following unexpected value assignment `=\"...\"`.\n*   The syntax `<input disabled :placeholder=\"...\">` is now treated as an `input` element with two attributes named `disabled` and `:placeholder`.\n    *   The original code treated this like `<input disabled:placeholder=\"...\">`, resulting in an `input` element with only one attribute named `disabled:placeholder`.\n\nAs a result, these AlpineJS examples now work as expected:\n\n```md\n<input type=\"text\" :placeholder=\"placeholder\">\n<input type=\"text\" disabled :placeholder=\"placeholder\">\n<div :class=\"open ? '' : 'hidden'\">Test</div>\n<div :style=\"true && { color: 'red' }\">Test</div>\n```\n\n### Attribute names can start with `@`\n\nThe original code did not allow attribute names to start with `@`. Our forked version allows this.\n\nAs a result, these examples using the AlpineJS shorthand syntax for `x-on:` now work as expected:\n\n```md\n<button @click=\"handleClick\">Test</button>\n```\n\n### Attribute names can contain dots (`.`)\n\nThe original code did not allow attribute names to contain dots. Our forked version allows this.\n\nAs a result, in combination with our change that allows `@` to start attribute names, these AlpineJS examples now work as expected:\n\n```md\n<button @click.once=\"console.log('I will only log once')\">Test</button>\n<input @input.debounce=\"fetchResults\">\n<input @input.debounce.500ms=\"fetchResults\">\n<div @keyup.escape.window=\"...\">Test</div>\n```\n","readmeFilename":"readme.md"}