{"_id":"@mdit-vue/plugin-sfc@4.0.0","bugs":{"url":"https://github.com/mdit-vue/mdit-vue/issues"},"dist":{"shasum":"204624f0c86b366980facbf1dc03b77776907808","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-sfc/download/@mdit-vue/plugin-sfc-4.0.0.tgz","fileCount":5,"integrity":"sha512-PolNeZ3zJLcVahGN3j/97kVv6I1M2yKx1HU6O31hPuBAKCEXJTXvE4UDkomv6jPVuOkvAemIDqNIscbN4Gn55Q==","signatures":[{"sig":"MEUCIQD7GWS8xkB6nikDvw4DNnE6zGQ+tu2v5Rpuehvghv9bMwIgNO1l4AO+afuA+IA74Al3X6Yu0/ee6hv1//saP8aeBCg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCiroaEQxp5WrRfaYu/BjHkbxpfAUAobHSUbZIYlfgZGAIhAKF8FbGdzZAH4BSlxHVkMJVavRibQmkfEwb55Fuh85cK"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@mdit-vue%2fplugin-sfc@4.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":8011,"size":3377,"noattachment":false,"key":"/@mdit-vue/plugin-sfc/-/@mdit-vue/plugin-sfc-4.0.0.tgz"},"name":"@mdit-vue/plugin-sfc","type":"module","types":"./dist/index.d.ts","author":{"name":"meteorlxy","email":"meteor.lxy@foxmail.com"},"engines":{"node":">=20.19.0"},"exports":{".":"./dist/index.js","./package.json":"./package.json"},"gitHead":"62f17856a1a5dec0e33c6487453a927b82a5883b","license":"MIT","scripts":{"test":"vitest","build":"tsdown","clean":"rimraf ./dist"},"version":"4.0.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"82ea33cb-cbea-485e-bd77-1d2a1aa988a6"}},"homepage":"https://github.com/mdit-vue","keywords":["markdown-it","markdown-it-plugin","sfc","vue"],"repository":{"url":"git+https://github.com/mdit-vue/mdit-vue.git","type":"git"},"_npmVersion":"lerna/5.8.0/node@v26.13.0+x64 (linux)","description":"A markdown-it plugin to help transforming markdown to vue sfc","directories":{},"maintainers":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com"}],"_nodeVersion":"26.13.0","dependencies":{"markdown-it":"^15.0.3","@mdit-vue/types":"4.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.23.7","vitest":"^5.1.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-sfc_4.0.0_1794239321883_0.7844852340861926"},"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 { Env } from 'markdown-it';\nimport MarkdownIt from 'markdown-it';\n\nconst md = MarkdownIt({ html: true }).use(sfcPlugin, {\n  // options\n});\nconst env: Env = {};\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":1794239321982,"_cnpm_publish_time":1794239321982,"dist-tags":{"latest":"4.0.0"}}