Skip to content

ganderzz/slate-md-serializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slate to Markdown Serializer

Currently supports

  • Bold
  • Italic
  • Headers

How to use

Basic

import { serialize } from "slate-md-serializer";

const markdown = serialize(mySlateValue);

Adding custom options

import { serialize } from "slate-md-serializer";

const markdown = serialize(mySlateValue, {
  parseMark: (type, text) => {
    if (type === "BOLD") {
      return `******${text}******`;
    }

    // Return the base text if we find nothing to convert to!
    // This part is important for nested structures
    return text;
  }
});

Contributions Welcome!

About

Slate Markdown Serializer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published