{"name":"@mdit-vue/plugin-sfc","version":"0.9.2","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.9.2","@types/markdown-it":"^12.2.3","markdown-it":"^13.0.1"},"publishConfig":{"access":"public"},"gitHead":"11b8e8654846fc959d219dbe89f93c62a4b8f109","_id":"@mdit-vue/plugin-sfc@0.9.2","_nodeVersion":"16.14.2","_npmVersion":"lerna/1.10.0/node@v16.14.2+x64 (linux)","dist":{"integrity":"sha512-WLzVVBI7j5E3LhI5yX6+cEdD1XuTv2dHLXbQRLW1X9txQyjhrOY12SBkn0RDiD119YzBXR+m4dXlw12uniX62g==","shasum":"b0bf5cfe46ab309ee7ed88ce5b1452eb0e98522d","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-sfc/download/@mdit-vue/plugin-sfc-0.9.2.tgz","fileCount":6,"unpackedSize":10093,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICaAxrvFoCpQoCTsbiEeuJhqjC7wf+1Ve70biZ9d2laLAiEA7fAWR1SGg3hP7IgDETOVPr1YJb8lbzMvQ8zma86E9Cg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/q5kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpzjw//YShSSKEPnSqJfD6meMHThHdeTkpq7cfSeuvMvrFmjb+w9VTi\r\nT8zrk6yQMh7y1PreWoYVCaRjyiLoVmHkrbmU/jJ7Ymxo+4CyExdhjGQeB4qd\r\n1bFYps3TE9agvleTWU1jK6YNLu3lVAbqrl1HW48RfagixDODY0F81CTWjlrU\r\nhq81mGHB7gFkKBGSD9sGazFJTstvJFbkQVcFsdV9grMuUEnSX+iTKFBp4R2u\r\n+Lj7vQKtPy5Bf7ErUpAGfqrZBuvrTsDzEJprwK8fmv15dYE2D30Xr/d5E5Wr\r\nulD/bJlpnP6Mef62I3UNJ0KvN8+WBKPNf+gflZlp6xPYeeyKLh0tRoa17y90\r\n4lpT7CZzwSKX0ELlGauUUuHZy8KEYmlYwJxOECjsqE6pUHhfRg+OwIFLG8kq\r\nUQPolcmvAj1KjzUKrMjmUCa9DeCkBEAvBldZi/DfXl/nx+Y3Rs4xBopW3fIw\r\n3KKZ3h7H/ZEQsCawqEKEV2Bm/AK/NY3PIbP36mUbQnVqnQGOfeQi8UyW26tg\r\n1RfWfT/aztXq3R16MH8y1ZDn4cOKehHpuo++emVHRYuazaW2R26XmJzV67pK\r\nxVq9CscPnF2rSDZyCn/mXwOpjxNQuAJXQifWGjAk8lEliIuEYQIm+qbT4c3x\r\n+JC7aZHen24ZpZWJsZ48FT928YYVl9GD01I=\r\n=ek1B\r\n-----END PGP SIGNATURE-----\r\n","size":3302,"noattachment":false,"key":"/@mdit-vue/plugin-sfc/-/@mdit-vue/plugin-sfc-0.9.2.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.9.2_1660857956007_0.7291570000183363"},"_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":1660857956255,"_cnpm_publish_time":1660857956255,"dist-tags":{"latest":"4.0.0"}}