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

slate-mark

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slate-mark

Slate to Markdown

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

slate-mark

Slate to Markdown parser.

Compatible with plate-editor out of the box.

Usage

// if using with typescript, import type from '@udecode/plate-core' or `@udecode/plate`
// please make sure your input has similar strucutre to TNode
import type { TNode } from '@udecode/plate-core'
// or 
// import type { TNode } from '@udecode/plate'

import { plateToMarkdown, plateToMarkdownAsync } from 'slate-mark'

// input type is `TNode` (https://plate-api.udecode.io/modules.html#tnode)
const myInput: TNode = [
    {
    type: 'p',
    children: [
      {
        text: 'Hello `universe !!!`',
      },
    ],
  },
  ...
]

// sync version
// output will be a markdown string
const output = plateToMarkdown(myInput)

// async/promise version
plateToMarkdownAsync(myInput)
    .then(result => {
        // result will be a markdown string
    })

Please make sure you have either @udecode/plate-core or @udecode/plate as your dependency if you are using it with typescript. The input type for the parser utility functions is TNode

Keywords

FAQs

Package last updated on 31 Oct 2021

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