Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mdit-vue/plugin-sfc

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mdit-vue/plugin-sfc

A markdown-it plugin to help transforming markdown tu vue sfc

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17K
decreased by-12.88%
Maintainers
1
Weekly downloads
 
Created
Source

@mdit-vue/plugin-sfc

npm

A markdown-it plugin to help transforming markdown to Vue SFC.

  • Extract all SFC blocks except <template> from rendered result to markdown-it env.sfcBlocks.
  • Support extracting custom blocks.

Install

npm i @mdit-vue/plugin-sfc

Usage

This plugin will only take effects when the html option of markdown-it is enabled:

import MarkdownIt from 'markdown-it';
import { sfcPlugin } from '@mdit-vue/plugin-sfc';
import type { MarkdownItEnv } from '@mdit-vue/shared';

const md = MarkdownIt({ html: true }).use(sfcPlugin);
const env: MarkdownItEnv = {};

const rendered = md.render(
  `\
# foo

<script>
console.log('bar')
</script>
`,
  env,
);

const sfc = `<template>${rendered}</template>${env.sfcBlocks}`;

Keywords

FAQs

Package last updated on 23 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc