debian-mirror-gitlab/app/assets/javascripts/behaviors/markdown/serializer.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
444 B
JavaScript
Raw Normal View History

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);