Currently supports
- Bold
- Italic
- Headers
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!