{"name":"@mdit-vue/plugin-sfc","version":"0.8.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"},"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.8.0","@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":"7fd357a18b8bcc347cf17e2e78da3b3ed4242e58","_id":"@mdit-vue/plugin-sfc@0.8.0","_nodeVersion":"16.15.1","_npmVersion":"lerna/1.8.0/node@v16.15.1+x64 (linux)","dist":{"integrity":"sha512-fz/y6d0GKxRE61tl5T0nGxaCGEiFWjhhDoewvgilzGiD87Qpm2JvdowOr0YufWOwkBgWXTOjo4SDn7MG/udpYA==","shasum":"a5c21500a5bba0d128363810eacbca16df243f82","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-sfc/download/@mdit-vue/plugin-sfc-0.8.0.tgz","fileCount":6,"unpackedSize":5833,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFKbh2gdEjyMylwbEh7Cy8XaE8qGp1T+geIj/YQX7HftAiEA6DwH8y3V9PwEejQ+f+iT4jPjMqBlrZDu8sknJf44kTc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2it8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+wg//dPLk3OcuqtdoK+f+gOk0Zh72QUoNYSegYWh2Vqu9gJjq848u\r\nTMu3Y8QQOhFcSjtG3SQAqIpT5koILl6PiEMPnfEELTFfIaCiDwA68aXqY84s\r\nGW1Hmyg743hCOta4Mp2h5ucA4TJioAQKDWTljnVcyaa5gEDa/qhDALpNjXQw\r\nueZqux9nUIwCU0bH+fOh1iQDsdf8TKzMCLhTebZ/4Vm0YczMopeuq5XdYFgu\r\nTuWlj8a4hi20fkByrv6QAmHHn2Wx8qrJljxd4cx4Zh6jNAoE0olekWihKL41\r\n07Fg2C4QAmhgeuWLBwJNtiFV/wsspnnHaBl5s4KaI2uIQ02GORlnkDzTp798\r\nN8eGDRMAkylXABs5hWyc3+cbv4KNO6lE39WRwPDM/iqk6oFx5gWAUmAW5cgS\r\naYl4WD4DUjATfOBXa8BMYSw0viNNl1BpkTcCwkYvVbaqSU1YkXQOqKOaqjna\r\nh1HHuieqKtcslJMeS69R5KyQ10o09fxgB3ddiBbkBbEyd+CyiVlp7p4aihuI\r\nXjC+3KQNGsi6230gyxbpfn7GohkLUrauEm7MMMqEwwMLk8NSb1MWKy7ubU5W\r\nT/REE+f5ZURKMGsKvThVSNvvyCTVHtAyPG7VQB87Kbz4+XLyubTqhKdjnJ1k\r\n2qnW1AOZa3N2i+50MZyZlRIDakdnBFrYCbc=\r\n=Euiw\r\n-----END PGP SIGNATURE-----\r\n","size":2582,"noattachment":false,"key":"/@mdit-vue/plugin-sfc/-/@mdit-vue/plugin-sfc-0.8.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.8.0_1658465148538_0.3582270573763753"},"_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":1658465148733,"_cnpm_publish_time":1658465148733,"dist-tags":{"latest":"4.0.0"}}