debian-mirror-gitlab/app/assets/javascripts/behaviors/markdown/serializer.js
2022-05-07 20:08:51 +05:30

20 lines
444 B
JavaScript

import { MarkdownSerializer } from '~/lib/prosemirror_markdown_serializer';
import editorExtensions from './editor_extensions';
const nodes = editorExtensions.nodes.reduce(
(ns, { name, toMarkdown }) => ({
...ns,
[name]: toMarkdown,
}),
{},
);
const marks = editorExtensions.marks.reduce(
(ms, { name, toMarkdown }) => ({
...ms,
[name]: toMarkdown,
}),
{},
);
export default new MarkdownSerializer(nodes, marks);