{"name":"@mdit-vue/plugin-sfc","version":"0.3.0","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"},"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/shared":"0.3.0","@types/markdown-it":"^12.2.3","markdown-it":"^13.0.1"},"devDependencies":{"c8":"^7.11.3","unbuild":"^0.7.4","vitest":"^0.15.2"},"publishConfig":{"access":"public"},"gitHead":"bcbfd4705d747ee71d6c7c32f8be6155261e9c90","_id":"@mdit-vue/plugin-sfc@0.3.0","_nodeVersion":"16.14.2","_npmVersion":"lerna/1.5.1/node@v16.14.2+x64 (linux)","dist":{"integrity":"sha512-oAkinsVS2UVVmpESbg562G8PnSMzL0KhLf7hPJUG756mDizoG6L5TBLaoFgtr8SECHTXAXev61CiwHK+qTuBiA==","shasum":"6d20132acbc1c9244ed9e08cd0887ae9661becc7","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-sfc/download/@mdit-vue/plugin-sfc-0.3.0.tgz","fileCount":12,"unpackedSize":9239,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzREoVasaEVSASlc0CkW3SdmuM1wahZ2dacCBbKUE8RAIhAPsKtVBIyOFbnEgT+0Yfogza35DNmMjooiQu885zs+U/"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitnZUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmruGQ//Q+IJKLqlUXANsemK/Q7RDXp2MkPPqO+/RFW7cmP0u+VfNFZB\r\nrq1ZKS/HXIzOmRDaxvcrQ8Y3ySStMKYcyBJbZw7VDC1uDalMC8i9pYG+PFW9\r\nJxhFrlDViCQj4LXaOHDJ9nZtuGMN/l/qSbMq/kjpKdPqmBDRU4/2rqEMiTk0\r\nPBwy6OeUcpFg7S1Edc8Cncmo6uxY7MxYeQ50Oi4HXqBMvSQ+TCtGowM6wyLO\r\nUe1y/sD8KqCIy7k81qfDCEwWrh71gd3m5XgH8qCXPW6VOyVAiE7pHbzHtKoS\r\nddqNeHVVYlZrnhz7fvauUSAu4YFMwztGh9OGfwNwOHGT+i6Q0NaJaXw0cvOO\r\nzpNlUJR5z4fiKKCvXIfwwZbu6+8/NtqdW5VLgNJuf7AsBnb+hh6C6aIjMeoa\r\n0lfvN/BdFfLUIYA6Z68fHE2DA1Nj+7O1nc7lSQQZfrd5eI72Rc+4eBb1bIV+\r\nxGs5Zq573PcODGsCmt2LEWhCgVveRofzElv2S29Dm/Bh+HdBo8GZiWjhDAbZ\r\n6+Pfm27RX2N90zjyatGuTmj4Rq30zMOJoZfVwyXxOT3ubhPg3age/Iu+F9f2\r\nXe7XfVXDFunnoTXOdR1cQ0w+BmcgxiInTcIKlnzKxYH+8rW+OEiesfRUf+2x\r\nVp7mw8twxY19z6su87QYszcNHVPxeOPqMzM=\r\n=6a74\r\n-----END PGP SIGNATURE-----\r\n","size":3647,"noattachment":false,"key":"/@mdit-vue/plugin-sfc/-/@mdit-vue/plugin-sfc-0.3.0.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.3.0_1656125011855_0.7088210142968197"},"_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":1656125012042,"_cnpm_publish_time":1656125012042,"dist-tags":{"latest":"4.0.0"}}