2022-04-04 11:22:00 +05:30
|
|
|
import { MarkdownSerializer } from '~/lib/prosemirror_markdown_serializer';
|
2019-03-02 22:35:43 +05:30
|
|
|
import editorExtensions from './editor_extensions';
|
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
const nodes = editorExtensions.nodes.reduce(
|
|
|
|
(ns, { name, toMarkdown }) => ({
|
|
|
|
...ns,
|
|
|
|
[name]: toMarkdown,
|
|
|
|
}),
|
|
|
|
{},
|
|
|
|
);
|
2019-03-02 22:35:43 +05:30
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
const marks = editorExtensions.marks.reduce(
|
|
|
|
(ms, { name, toMarkdown }) => ({
|
|
|
|
...ms,
|
|
|
|
[name]: toMarkdown,
|
|
|
|
}),
|
|
|
|
{},
|
|
|
|
);
|
2019-03-02 22:35:43 +05:30
|
|
|
|
|
|
|
export default new MarkdownSerializer(nodes, marks);
|