{"name":"@mdit-vue/plugin-sfc","version":"0.7.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.7.1","@types/markdown-it":"^12.2.3","markdown-it":"^13.0.1"},"devDependencies":{"c8":"^7.12.0","unbuild":"^0.7.6","vitest":"^0.18.1"},"publishConfig":{"access":"public"},"gitHead":"b4b8bc6c054ea2dd9ad9ec7a37a58b5a2147b2bd","_id":"@mdit-vue/plugin-sfc@0.7.1","_nodeVersion":"16.14.2","_npmVersion":"lerna/1.6.0/node@v16.14.2+x64 (linux)","dist":{"integrity":"sha512-Ba4s/XpRp0BWNsBCKVzFdMxXXTd9aDTcwjPkx7SyWJwTIFlPAlcEPF9Dk17mutSE8eMxP4eU5pbpFQ+ZwdB3fQ==","shasum":"5a82dd97944e0c95fdc5f61da1d26d5e9ab7902c","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-sfc/download/@mdit-vue/plugin-sfc-0.7.1.tgz","fileCount":6,"unpackedSize":5833,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAiM52zIpBjS26FkQ9QkNf2TUGf9fB7vDVew237p3mrIAiEApVU1Gp5kpZfF9PPiVeixdXItoSOqKem4MG1GRKhcy9o="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2DX1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqebg//X35xSSxh9j2w5jvySCVdZHPZcrOAVyO409sfiMqAtCwq5kVb\r\nX46FI+vVeiLEt/u0sDGTace6MGkAgDlT73tuh1nMQ4H7Ap0ajo6UwxwBnUYD\r\nFUoTmJCRSb+boD+D9352Ry7Y3/re3hF4m1qZyE2rqww4fpP/vMWg8EiF5ijT\r\nCX+eYlZswIuoNtYEWzRyp5EWAfncj0sddVpxg2Lbs3vlP7Aw3Y5iXlzRLvrV\r\n38RjvvcIcvGodMuPIAaKC/4Op//FDZr+9DNYJt9HWyfGNAQSYJq6ftvcO30H\r\ne7BAliGww1e1E03WvI3akSkU1G/AZcPIDuciyGiFkjr4oxqXH2jRSt+7wQy9\r\n8USfFU0Y5QXCsUWJ1uJpR9R0RXo+K7udbc/yhnUVyvLdCIihJIYnSnlfQuVf\r\nMUBIHFeRDilmKxHc+tz5GgO6OW9+eeXU6XPBD+JfhHdVWtAho9wjmomxPS7v\r\nlOHSu/8BvZPpPmDk6NHYUA8kUBR/6NEWQZvCnqEmhP1NQpX+j7cOw7nBtLr9\r\nCK16Ee1UErnIe/d5VtpH/l3Z7c67XZMrtM6Kk/lUfC0SJSRh+/ouM9EnEFmN\r\nc11PgmZ+OkUDGC61zjrcHtIZKauFQfUuVafrdObOHoyikg4EoMRdXr7fqB3W\r\niwC0TB5n/43BZcC71b7KX/jk48B+eC39zp0=\r\n=phIY\r\n-----END PGP SIGNATURE-----\r\n","size":2583,"noattachment":false,"key":"/@mdit-vue/plugin-sfc/-/@mdit-vue/plugin-sfc-0.7.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.7.1_1658336757372_0.9057003705384226"},"_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":1658336757519,"_cnpm_publish_time":1658336757519,"dist-tags":{"latest":"4.0.0"}}