{"name":"@mdit-vue/plugin-sfc","version":"0.12.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.12.0","@types/markdown-it":"^12.2.3","markdown-it":"^13.0.1"},"publishConfig":{"access":"public"},"gitHead":"986b6023d3460cadefd409cd5d4b6445af3a05bd","_id":"@mdit-vue/plugin-sfc@0.12.0","_nodeVersion":"18.13.0","_npmVersion":"lerna/1.15.1/node@v18.13.0+arm64 (darwin)","dist":{"integrity":"sha512-mH+rHsERzDxGucAQJILspRiD723AIWMmtMhp7lDKdkCIbIhYfupFv/CkSeX+LAx5UY5greWvUTPGYVKn4gw/5Q==","shasum":"2932c333657ddaf6d76664118b83c93d5dd4f727","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-sfc/download/@mdit-vue/plugin-sfc-0.12.0.tgz","fileCount":6,"unpackedSize":10657,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICFsKdxmTDs/ft1YLzrmZfHtGKKVQ+fQn5FKjsUWcCWyAiEA+VHrFAgtbTtexxD0wZPpdj0AaDHS7p7rQe6kMCOqBLk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5cXUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmohng//UkLCdGhGfaM8cpSvAq12KJfOVCLXBxklLj8FVv7LCK3Y+PPX\r\nMEh5Tg4LaG9HXgbZ8jgB0zH4ImJ47yqzcpFdGkJvNEW3sZV6QPWaI/1Svwg1\r\nzCVDypLhBCijMrieltbzfcAZwbwknre/qRZUvnreAh0jAfk17DNdf17BwDgQ\r\nFUTfS2749yQwHl0uDqkAyHPN7tfQAVfYejzoNFq029n6eMsN/iPNlN5bFvo8\r\n841wiKEZBRUrNRNPJkoRzh9RIlV9X8H3QYN8DO90uyywk5gA0L9RNkMDFYju\r\nqtte+bRYaqP/IfZWnZ/2DGUJ+vp1kUxQsnx4Oh5kktlsTkYcAmIyclBRyO0R\r\ni+XJXEhwUT0TwFyXuRjGGJJeQtIAr7vAG4VOetzoHkysOEQoEMlMThU2G6xl\r\nLfg6eS4NdOsoK8Fl3NUdqPnmqBpgNnW3R6o12Z/4EeX4FAxB6ksZJkaA5kPj\r\nfU090vh+Rt06vqsE1u1+zdJcqZzU7FIb/Ar2f7bWmRO3+CcE5AuC3hjRzuWn\r\njzNkBeHyMloV16y8sdPClXk3rAa6PCRNWPwrB0Uj+ZHNJ8fVqYWZUZIzsBUr\r\n8poUdqBJV5DEaelwAO7QqNbCr5PsOzXtwzyiTgeJawRmPeXim9IUPk31Fi6e\r\npiqLO45in+TwGGk5CJE6T41zf18YlsGImP8=\r\n=Ccab\r\n-----END PGP SIGNATURE-----\r\n","size":3391,"noattachment":false,"key":"/@mdit-vue/plugin-sfc/-/@mdit-vue/plugin-sfc-0.12.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.12.0_1676002771900_0.8079524668457176"},"_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":1676002772116,"_cnpm_publish_time":1676002772116,"dist-tags":{"latest":"4.0.0"}}