{"_id":"remark-imgattr","_rev":"8-c14e5d9e214518dcd41f0559ebc0ce32","name":"remark-imgattr","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"remark-imgattr","version":"1.0.0","keywords":["remark","image","attributes"],"author":{"name":"Oliver Speir"},"license":"MIT","_id":"remark-imgattr@1.0.0","maintainers":[{"name":"oliverspeir","email":"oliverspeir9@gmail.com"}],"homepage":"https://github.com/OliverSpeir/remark-imgattr#readme","bugs":{"url":"https://github.com/OliverSpeir/remark-imgattr/issues"},"dist":{"shasum":"8052d77a84c1cbe2cfbb7c59fed6c687717d6df1","tarball":"https://registry.npmjs.org/remark-imgattr/-/remark-imgattr-1.0.0.tgz","fileCount":4,"integrity":"sha512-ne+eqPhh9kER0CblEuBHbejW71JXqthfBmuxfBW6IYam+wmLSgf0emMLHhEpD0GucCqNS2zRKA8Zx2UJMMQ+PA==","signatures":[{"sig":"MEUCIQCeX1pbwgaEqUdNGkSi2PPF4EwQPac3DSthY/r9B7xltwIgVs4Or108cMGzkRkM1rYvbc4G8IxZwbdePaeQOGSxfVM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5738},"main":"index.js","type":"module","gitHead":"2f4a5a0d196b66edbe8834d5f2252a6e9bb4de49","_npmUser":{"name":"oliverspeir","email":"oliverspeir9@gmail.com"},"repository":{"url":"git+https://github.com/OliverSpeir/remark-imgattr.git","type":"git"},"_npmVersion":"10.2.3","description":"add attributes to remark imgs by adding them inside curly brackets like ![](){}","directories":{},"_nodeVersion":"18.19.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/remark-imgattr_1.0.0_1704696546664_0.527285239597699","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"remark-imgattr","version":"1.0.1","keywords":["remark","image","attributes"],"author":{"name":"Oliver Speir"},"license":"MIT","_id":"remark-imgattr@1.0.1","maintainers":[{"name":"oliverspeir","email":"oliverspeir9@gmail.com"}],"homepage":"https://github.com/OliverSpeir/remark-imgattr#readme","bugs":{"url":"https://github.com/OliverSpeir/remark-imgattr/issues"},"dist":{"shasum":"5a74b63d2b6983df45177c371516fb48bc3f7013","tarball":"https://registry.npmjs.org/remark-imgattr/-/remark-imgattr-1.0.1.tgz","fileCount":5,"integrity":"sha512-n4qIjecsjkYeStH+mHExv5M8H/hxaCPDVohl/HjcUQXOkgi6yEAtdGc92u+7Tk25XE4DU55Hj5beGaokFIbOTQ==","signatures":[{"sig":"MEYCIQDh4DyL1gYcIVp3WXBWoklMDZfsgHb5Ia4IoDN/yCajWwIhAKjV/wpGqdPabKwkTHldGsn3nuXabABkEGjJInt598Tz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6054},"main":"index.js","type":"module","types":"types.d.ts","gitHead":"3f960c0d7619d4d757881ec2062572da7c26850e","_npmUser":{"name":"oliverspeir","email":"oliverspeir9@gmail.com"},"repository":{"url":"git+https://github.com/OliverSpeir/remark-imgattr.git","type":"git"},"_npmVersion":"10.2.3","description":"add attributes to remark imgs by adding them inside curly brackets like ![](){}","directories":{},"_nodeVersion":"18.19.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/remark-imgattr_1.0.1_1704698091802_0.19284026837167723","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"remark-imgattr","version":"1.0.2","keywords":["remark","image","attributes"],"author":{"name":"Oliver Speir"},"license":"MIT","_id":"remark-imgattr@1.0.2","maintainers":[{"name":"oliverspeir","email":"oliverspeir9@gmail.com"}],"homepage":"https://github.com/OliverSpeir/remark-imgattr#readme","bugs":{"url":"https://github.com/OliverSpeir/remark-imgattr/issues"},"dist":{"shasum":"b54554d0d665ca2caedd81ff7bfbed31bfdc358c","tarball":"https://registry.npmjs.org/remark-imgattr/-/remark-imgattr-1.0.2.tgz","fileCount":5,"integrity":"sha512-l0iQKd5nN9SVhFqA3hzFsUArHFkwHZqRknBgQ4Ze7cbFuuZNtCyK8pO1+Zh2O7vAlZd3bPY2VYtHAA/sM2GN/w==","signatures":[{"sig":"MEQCIDhYl0dTzV5G/MTJfbi+ODbaZ8Dk6+z7AgZYeLtfQBn0AiA5R3+UoO/RIk2Kz1SurXI9M1t6Mh2kaaaJsVJ/V+YblA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6257},"main":"index.js","type":"module","types":"types.d.ts","gitHead":"1e0296bbd2b77abb755cd23a0b6f7d06f6b3b2f0","_npmUser":{"name":"oliverspeir","email":"oliverspeir9@gmail.com"},"repository":{"url":"git+https://github.com/OliverSpeir/remark-imgattr.git","type":"git"},"_npmVersion":"10.2.3","description":"add attributes to remark imgs by adding them inside curly brackets like ![](){}","directories":{},"_nodeVersion":"18.19.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/remark-imgattr_1.0.2_1705276893875_0.5337500024580235","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"remark-imgattr","version":"1.0.3","keywords":["remark","image","attributes"],"author":{"name":"Oliver Speir"},"license":"MIT","_id":"remark-imgattr@1.0.3","maintainers":[{"name":"oliverspeir","email":"oliverspeir9@gmail.com"}],"homepage":"https://github.com/OliverSpeir/remark-imgattr#readme","bugs":{"url":"https://github.com/OliverSpeir/remark-imgattr/issues"},"dist":{"shasum":"f07a4e8f30954e701383d9926df6aacd170c0dc6","tarball":"https://registry.npmjs.org/remark-imgattr/-/remark-imgattr-1.0.3.tgz","fileCount":5,"integrity":"sha512-6by5+996jyg4cCjqmEqU/KKXDGUOzl5eLUZu064T5KVqlacKRbj4TTjUr7SGwKolCWlmIleZ5Ekz77pe7b7UUA==","signatures":[{"sig":"MEUCIQDTU/dooivOJhDJduslvWm8n2sehzm3iCf2BQeNGUGhWAIgJsFfKf5C5eAlsZojDOE6EBupkd5gPDi5zLJj0PA2E2Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6702},"main":"index.js","type":"module","types":"types.d.ts","gitHead":"ee7d7e7f88c33181bb4cb22206bd2bee25e8f0ac","_npmUser":{"name":"oliverspeir","email":"oliverspeir9@gmail.com"},"repository":{"url":"git+https://github.com/OliverSpeir/remark-imgattr.git","type":"git"},"_npmVersion":"10.2.3","description":"add attributes to remark imgs by adding them inside curly brackets like ![](){}","directories":{},"_nodeVersion":"18.19.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/remark-imgattr_1.0.3_1705353722689_0.9615416459062001","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"remark-imgattr","version":"1.0.4","keywords":["remark","image","attributes","markdown","mdx"],"author":{"name":"Oliver Speir"},"license":"MIT","_id":"remark-imgattr@1.0.4","maintainers":[{"name":"oliverspeir","email":"oliverspeir9@gmail.com"}],"homepage":"https://github.com/OliverSpeir/remark-imgattr#readme","bugs":{"url":"https://github.com/OliverSpeir/remark-imgattr/issues"},"dist":{"shasum":"c9a7883ffffe59612d4820cb3fecbec8b5fc5317","tarball":"https://registry.npmjs.org/remark-imgattr/-/remark-imgattr-1.0.4.tgz","fileCount":6,"integrity":"sha512-sqlHn40sEY3fuvWi2jKKCiYqzED/12YBwOOhBmqM8aVchzUAEk+QNJgPe4VFuPwgs9xxQNc6PIwFu2miN58ikw==","signatures":[{"sig":"MEUCIArh/k//WocpF799RDmk31MWovHuHMsLep1Iaum1EpHrAiEAyH3DMAWqlyhiC9huZ0I7aD1maoVkAFieRVkZOWPJkzw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9628},"main":"index.js","type":"module","types":"types.d.ts","gitHead":"6315cb8d156532cc76ac07e19606a3dc99876920","_npmUser":{"name":"oliverspeir","email":"oliverspeir9@gmail.com"},"repository":{"url":"git+https://github.com/OliverSpeir/remark-imgattr.git","type":"git"},"_npmVersion":"10.2.3","description":"add attributes to markdown and mdx images like ![alt](path)(attribute: value)","directories":{},"_nodeVersion":"18.19.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/remark-imgattr_1.0.4_1712663196942_0.6725303474552968","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"remark-imgattr","version":"1.0.5","keywords":["remark","image","attributes","markdown","mdx"],"author":{"name":"Oliver Speir"},"license":"MIT","_id":"remark-imgattr@1.0.5","maintainers":[{"name":"oliverspeir","email":"oliverspeir9@gmail.com"}],"homepage":"https://github.com/OliverSpeir/remark-imgattr#readme","bugs":{"url":"https://github.com/OliverSpeir/remark-imgattr/issues"},"dist":{"shasum":"f22748efff788c960432cb7df5422328f35e106b","tarball":"https://registry.npmjs.org/remark-imgattr/-/remark-imgattr-1.0.5.tgz","fileCount":6,"integrity":"sha512-Goa7uOvKE9iYNsCFvKwePsuvk84VR/O0HFn68vDsuDGoJVY1IfUhCPqhJRS3F69g4tNoSmMkcDTCXw8Tof6ldw==","signatures":[{"sig":"MEUCIQDBMgri5m3rHX2e2VHFBNNRATFmRYftFAH4fwDnbPCrtAIgEGOPLuzIkVXnbdi7ZqRUDUvAiUkAT66goD743YJWuTA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9600},"main":"index.js","type":"module","types":"types.d.ts","gitHead":"6f50ef2296f1ebffd006aacae1d2290b3a1791a0","_npmUser":{"name":"oliverspeir","email":"oliverspeir9@gmail.com"},"repository":{"url":"git+https://github.com/OliverSpeir/remark-imgattr.git","type":"git"},"_npmVersion":"10.2.3","description":"add attributes to markdown and mdx images like ![alt](path)(attribute: value)","directories":{},"_nodeVersion":"18.19.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/remark-imgattr_1.0.5_1712663450428_0.2940118479332994","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"remark-imgattr","version":"1.1.0","keywords":["remark","image","attributes","markdown","mdx"],"author":{"name":"Oliver Speir"},"license":"MIT","_id":"remark-imgattr@1.1.0","maintainers":[{"name":"oliverspeir","email":"oliverspeir9@gmail.com"}],"homepage":"https://github.com/OliverSpeir/remark-imgattr#readme","bugs":{"url":"https://github.com/OliverSpeir/remark-imgattr/issues"},"dist":{"shasum":"92a075b23b43a943e0392a08c64a72d3a364531a","tarball":"https://registry.npmjs.org/remark-imgattr/-/remark-imgattr-1.1.0.tgz","fileCount":5,"integrity":"sha512-ysiwMQXH13+ARLfq1moV3N6SsR5DmYvFx0kxiwlvIfe2Lrq9J115MgKHclLJnNCSnaYW3Pq0YgbXctOwcyek2w==","signatures":[{"sig":"MEUCIQDsb3+pCzEscIrIs61GfGODgqI6dllmSviYJkWLfSC8IwIgEtoyJNGUuWBMY1R6QTSoTQ90yP6JF68wGx36Uf7lv+Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11005},"main":"index.js","type":"module","types":"types.d.ts","gitHead":"f108e9f9609eb493b83256f72f609acca092f10f","scripts":{"test":"node --test","test:integration":"node --test test/integration/**/*.test.js"},"_npmUser":{"name":"oliverspeir","email":"oliverspeir9@gmail.com"},"repository":{"url":"git+https://github.com/OliverSpeir/remark-imgattr.git","type":"git"},"_npmVersion":"11.6.2","description":"add attributes to markdown and mdx images like ![alt](path)(attribute: value)","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.30.1","devDependencies":{"unified":"^11.0.5","remark-parse":"^11.0.0","remark-rehype":"^11.1.1","node-html-parser":"^6.1.13","rehype-stringify":"^10.0.1"},"_npmOperationalInternal":{"tmp":"tmp/remark-imgattr_1.1.0_1771883886260_0.956995018090697","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"remark-imgattr","version":"1.1.1","description":"add attributes to markdown and mdx images like ![alt](path)(attribute: value)","main":"index.js","type":"module","types":"types.d.ts","scripts":{"test":"node --test","test:integration":"node --test test/integration/**/*.test.js"},"repository":{"type":"git","url":"git+https://github.com/OliverSpeir/remark-imgattr.git"},"keywords":["remark","image","attributes","markdown","mdx"],"author":{"name":"Oliver Speir"},"license":"MIT","packageManager":"pnpm@10.30.1","bugs":{"url":"https://github.com/OliverSpeir/remark-imgattr/issues"},"homepage":"https://github.com/OliverSpeir/remark-imgattr#readme","devDependencies":{"node-html-parser":"^6.1.13","rehype-stringify":"^10.0.1","remark-parse":"^11.0.0","remark-rehype":"^11.1.1","unified":"^11.0.5"},"gitHead":"71e0e6a79b6eb30d31f4a5ab8245a20c5e75796e","_id":"remark-imgattr@1.1.1","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-L5fQJfD+JGY2Gak2S8ic4h5TvW3yfcbk3hK4J0mKU66rzIhrNrCrASGvfo/Q6kpnVMasF4rarsTF61AfrpqIbg==","shasum":"bc4d8eaf672e1be773b4f5be07e3122c31b8cb06","tarball":"https://registry.npmjs.org/remark-imgattr/-/remark-imgattr-1.1.1.tgz","fileCount":5,"unpackedSize":10884,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGathncU47SNHmVANDTul7iVVvnTSQxvD6mSRN6XvoVTAiEA/cyezSOjYo0dnZ1sMBCcjdljRitH3hsMy0b6xN2nlEs="}]},"_npmUser":{"name":"oliverspeir","email":"oliverspeir9@gmail.com"},"directories":{},"maintainers":[{"name":"oliverspeir","email":"oliverspeir9@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/remark-imgattr_1.1.1_1771884509971_0.7774581785503203"},"_hasShrinkwrap":false}},"time":{"created":"2024-01-08T06:49:06.663Z","modified":"2026-02-23T22:08:30.214Z","1.0.0":"2024-01-08T06:49:06.800Z","1.0.1":"2024-01-08T07:14:51.965Z","1.0.2":"2024-01-15T00:01:34.051Z","1.0.3":"2024-01-15T21:22:02.828Z","1.0.4":"2024-04-09T11:46:37.137Z","1.0.5":"2024-04-09T11:50:50.576Z","1.1.0":"2026-02-23T21:58:06.395Z","1.1.1":"2026-02-23T22:08:30.092Z"},"bugs":{"url":"https://github.com/OliverSpeir/remark-imgattr/issues"},"author":{"name":"Oliver Speir"},"license":"MIT","homepage":"https://github.com/OliverSpeir/remark-imgattr#readme","keywords":["remark","image","attributes","markdown","mdx"],"repository":{"type":"git","url":"git+https://github.com/OliverSpeir/remark-imgattr.git"},"description":"add attributes to markdown and mdx images like ![alt](path)(attribute: value)","maintainers":[{"name":"oliverspeir","email":"oliverspeir9@gmail.com"}],"readme":"# Remark Image Attributes\n\nRemark plugin to add attributes to markdown and mdx images\n\nAdds attributes to images by extending the default syntax like `![](path)(attribute1: value, attribute2: value)`. Attributes are applied to the image's `hProperties`, enabling framework component props in Astro and other unified pipelines.\n\n> [!NOTE]\n> If using [remark-unwrap-images](https://github.com/remarkjs/remark-unwrap-images) run this plugin first\n\n## Syntax\n\n```md\n![alt](path)(key: value, key: value, ...)\n```\n\nAttributes are a comma-separated list of `key: value` pairs in a second set of parentheses after the image.\n\n| Value type | Example | Notes |\n|---|---|---|\n| String | `class: hero` | No quotes needed for simple strings |\n| Number | `width: 300` | Integers and decimals supported |\n| Boolean | `defer: true` | Passed as a boolean to `hProperties` |\n| Quoted string | `title: \"my photo\"` | `\"` `'` `\"` `'` all supported; backslash escape with `\\` |\n| CSS value | `style: border: 1px solid red;` | Colons in values are fine |\n| Array | `widths: [300, 600, 900]` | Parsed as a JS array |\n| Nested object | `data: (x: 100, y: 200)` | Parsed as a JS object |\n| JSON object | `metadata: {\"key\": \"val\"}` | Parsed as a JS object |\n\n### Quoting\n\nCommas inside `[]` arrays and `()` nested structures are handled automatically. Plain string values that contain commas must be quoted, otherwise the value will be silently truncated at the first comma:\n\n```md\n<!-- correct: quoted string value containing a comma -->\n![](path)(sizes: \"(min-width: 600px) 600w, 300w\")\n\n<!-- correct: commas inside [] are fine without quotes -->\n![](path)(widths: [300, 600, 900])\n```\n\n## Usage in Astro\n\n```js\nimport { defineConfig } from 'astro/config';\nimport imgAttr from 'remark-imgattr';\n\n// https://astro.build/config\nexport default defineConfig({\n\tmarkdown: {\n\t\tremarkPlugins:[imgAttr]\n\t}\n});\n```\n\n### Setting default attributes\n\nYou can pass default attributes that will apply to all markdown and mdx images:\n\n```js\nimport { defineConfig } from 'astro/config';\nimport imgAttr from 'remark-imgattr';\n\n// https://astro.build/config\nexport default defineConfig({\n\tmarkdown: {\n\t\tremarkPlugins:[\n\t\t\t[imgAttr, { defaults: { width: 700, format: 'avif' } }],\n\t\t],\n\t},\n});\n```\n\nIf an image specifies the same attributes as `defaults`, the image's value for that attribute will be used instead of the default value.\n\n## Example\n\n```md\n![Style](path)(style: border: 1px solid #ccc; padding: 10px;, width: 100)\n\n![alt text](path)(width: 300, height: 150)\n```\n\n## Support for Astro Specific Syntax\n\n```md\n![](path)(width: 300, widths: [300, 600], sizes: \"(min-width: 600px) 600w, 300w\")\n\n![](path)(quality: 100, format: avif)\n```\n","readmeFilename":"README.md"}