{"name":"@mdit-vue/plugin-sfc","version":"0.4.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.4.0","@types/markdown-it":"^12.2.3","markdown-it":"^13.0.1"},"devDependencies":{"c8":"^7.11.3","unbuild":"^0.7.4","vitest":"^0.16.0"},"publishConfig":{"access":"public"},"gitHead":"744887e6f4733af8da2045625e72a476947cfc25","_id":"@mdit-vue/plugin-sfc@0.4.0","_nodeVersion":"16.14.2","_npmVersion":"lerna/1.6.0/node@v16.14.2+x64 (linux)","dist":{"integrity":"sha512-e/fLQ05PB7jrls6fffi8Qmnz+7iGlNaq72qlOtswOqeYisMYXR78J68I8mEO+qsgpo6AK1DsbCUF6hKTGFmFYQ==","shasum":"93b1a147bc76a87d9c5c5089981692ddaff836ae","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-sfc/download/@mdit-vue/plugin-sfc-0.4.0.tgz","fileCount":12,"unpackedSize":9450,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFzQpxuY16T5tiG8LL1fCyPAnBk0bptX/3neFO+KbcxwAiEA38GfgnR144+sDUd8IxBRjzByyTxJa/J2qM1ZYKcXkK8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiwHmiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoCqBAAos+ggXOLlWi6OO/EKXDw3bJy6snQuUZc7fVcaYyaR/keb6Kl\r\nraxtLN4xeOZIIC1ViUb5VDi7Gkx6aNyIpHMPLWWhOOVd6gfsW4Qssa/NvZN3\r\nTzps2Mn8OT6h9/eyFhayeb164mz/cV1xtUG+2L/FIErfeJLat3slkWxXisVt\r\nst9jS9vctG59shJJLSEp+oitTjHjF+LKPHKPllEJ+JW1RUEjJqY1BYYUizcv\r\nbyd8uhVs9dcN6oOwq8jwlK9TwYn/7Xf+Lbr57gZIfwoCqolotrIfKILni4/l\r\nJZ/Hpo5++v6RkOaOgym37ePhCxdcujWyO5hLS5CcupDGBx1i8tIm81ogCaq0\r\nDoLC0+fmXf1dkHUKyr42qDEs0NgSMnjMrprA3wT8yG/QCFmc3Kf046aWuJiV\r\nF/bk/792Vo9SV4GmMzbX4xriV7mJdf+YPa/rrGM6yAwApWSNExbUL5mmHL0t\r\nf1S8JITcjHNVplepbwo0Aww7M58uh87kapt5M92qnQXVPOQibhBLURCOVlE2\r\nZQjfrXC1u2m54c4dOAIGUwD1L3yeM2uHbI0WtdhmbnL9/oBjonQMHnq5TsiI\r\nLW8xNW80nYJ+2zV9ykHCyNA2hCi0T5cCGJT1vfIVzg7cvsHwcqgQFC0Ihi0i\r\no7XoTPB/LbC2zLo2a2e8zSwUzEBiinqzgh4=\r\n=cxET\r\n-----END PGP SIGNATURE-----\r\n","size":3705,"noattachment":false,"key":"/@mdit-vue/plugin-sfc/-/@mdit-vue/plugin-sfc-0.4.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.4.0_1656781218726_0.5130796886201829"},"_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":1656781218884,"_cnpm_publish_time":1656781218884,"dist-tags":{"latest":"4.0.0"}}