{"name":"@mdit-vue/plugin-sfc","version":"0.11.1","description":"A markdown-it plugin to help transforming markdown tu vue sfc","keywords":["markdown-it","markdown-it-plugin","vue","sfc"],"homepage":"https://github.com/mdit-vue","bugs":{"url":"https://github.com/mdit-vue/mdit-vue/issues"},"repository":{"type":"git","url":"git+https://github.com/mdit-vue/mdit-vue.git"},"license":"MIT","author":{"name":"meteorlxy","email":"meteor.lxy@foxmail.com"},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build":"unbuild","test":"vitest"},"dependencies":{"@mdit-vue/types":"0.11.0","@types/markdown-it":"^12.2.3","markdown-it":"^13.0.1"},"publishConfig":{"access":"public"},"gitHead":"98828479d07c7bc52d178a00cdb92c166eff09ee","_id":"@mdit-vue/plugin-sfc@0.11.1","_nodeVersion":"16.14.2","_npmVersion":"lerna/1.11.2/node@v16.14.2+x64 (linux)","dist":{"integrity":"sha512-3AjQXqExzT9FWGNOeTBqK1pbt1UA5anrZvjo7OO2PJ3lrfZd0rbjionFkmW/VW1912laHUraIP6n74mUNqPuWw==","shasum":"1e7102ea3f67f0761e482ac50c413f7e10e1ba41","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-sfc/download/@mdit-vue/plugin-sfc-0.11.1.tgz","fileCount":6,"unpackedSize":10721,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH8uXSSHQgGMt+jipQiH90zZDFQE/rds3yn/dt3UlkFtAiAc0/mHxtB6nixFQWZC++T10Cl6/HisTFCnrw3jGPYRlA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDePrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0mA/9GGK6eBEBaHDQAgOCaRTUAXTx+HT3eBJ1Hm3RnbKbnJbtU3rD\r\noAMI2X6/lYQLXX4zZENTqSwJAa+Z1kaV5jUXmJQ868LiWakBg3e7NpYunXt4\r\nIPN2Q+C67uE2OiGHbMUMtFjVjhLPuWbE3A8d6dD3gDqi1k8fu/tBPiTS7G3R\r\nag2aWkDTnigZLV+1AVJd2b7lmJBM3+OMxa8W/fSlOebibgCQ0tMWNglYHnOM\r\nhCpsUCmswUUlqzn8rMLXrsPktryacT6s4fokZjDzDtwBbF9Y/jugxFvlRk9r\r\nYnJ8TTOxlOdjETPtR46YV57IUs4w6Qq/BbjWAHydF0fDYU1w6VdHVi6YOYh5\r\n+siNOKD6yqEtTuqQ5aP08JOL3bUCqWpRolZqBaiWF6Dtt/5cnUNrQmwunLWr\r\n/ehvP7+xZWs4+bg48O8El7K/Vd5GBsS3JywDpCqYr/A88XHTpUCgSjOyjm+R\r\n+lbx1c6mV5FaYRlRR2W9zjgb3WhMUaQSA4OcDOnVnEWpuhRdhKwM9A3qyaUG\r\nI3nOw43XcOD8dxoeU3hxnF8cWeuIxawdXFKoeeQKaPhhVNkfxbAgVMMVbZUC\r\n9vhfUh+vqpkeC5351Yd2FXK7SAd1RLmLq1y9aPtxF8tqWVt5MOv29GTF3Dgp\r\nSork6D4n7VqvpS3PJIJD9yaB9gDTgnZ5zQY=\r\n=a6JF\r\n-----END PGP SIGNATURE-----\r\n","size":3437,"noattachment":false,"key":"/@mdit-vue/plugin-sfc/-/@mdit-vue/plugin-sfc-0.11.1.tgz"},"_npmUser":{"name":"meteorlxy","email":"meteor.lxy@foxmail.com"},"directories":{},"maintainers":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-sfc_0.11.1_1661854699517_0.21000466387793604"},"_hasShrinkwrap":false,"readme":"# @mdit-vue/plugin-sfc\n\n[![npm](https://badgen.net/npm/v/@mdit-vue/plugin-sfc)](https://www.npmjs.com/package/@mdit-vue/plugin-sfc)\n[![license](https://badgen.net/github/license/mdit-vue/mdit-vue)](https://github.com/mdit-vue/mdit-vue/blob/main/LICENSE)\n\nA [markdown-it](https://github.com/markdown-it/markdown-it) plugin to help transforming markdown to [Vue SFC](https://vuejs.org/guide/scaling-up/sfc.html).\n\n- Avoids rendering `<script>` and `<style>` tags and extract them into to markdown-it `env.sfcBlocks`.\n- Supports extracting custom blocks.\n- Provides `env.sfcBlocks.template` for convenience.\n\n## Install\n\n```sh\nnpm i @mdit-vue/plugin-sfc\n```\n\n## Usage\n\nThis plugin will only take effects when the `html` option of markdown-it is enabled:\n\n```ts\nimport { sfcPlugin } from '@mdit-vue/plugin-sfc';\nimport type { MarkdownItEnv } from '@mdit-vue/types';\nimport MarkdownIt from 'markdown-it';\n\nconst md = MarkdownIt({ html: true }).use(sfcPlugin, {\n  // options\n});\nconst env: MarkdownItEnv = {};\n\nconst rendered = md.render(\n  `\\\n# foo\n\n<script>\nconsole.log('bar')\n</script>\n`,\n  env,\n);\n\nconsole.log(env.sfcBlocks);\n```\n\n## Options\n\n### customBlocks\n\n- Type: `string[]`\n\n- Default: `[]`\n\n- Details:\n\n  SFC custom blocks to be extracted.\n\n  By default, only `<script>` and `<style>` tags will be extracted. You can set this option to support SFC custom blocks in markdown.\n\n  For example, if you set this option to `['i18n']`, the `<i18n>` tag in your markdown content will be extracted to `env.sfcBlocks.customBlocks` and won't appear in the rendered result.\n","publish_time":1661854699724,"_cnpm_publish_time":1661854699724,"dist-tags":{"latest":"4.0.0"}}