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

19 lines
516 B
JavaScript

import { defaultMarkdownSerializer } from '~/lib/prosemirror_markdown_serializer';
// Transforms generated HTML back to GFM for Banzai::Filter::MarkdownFilter
export default () => ({
name: 'blockquote',
schema: {
content: 'block*',
group: 'block',
defining: true,
draggable: false,
parseDOM: [{ tag: 'blockquote' }],
toDOM: () => ['blockquote', 0],
},
toMarkdown(state, node) {
if (!node.childCount) return;
defaultMarkdownSerializer.nodes.blockquote(state, node);
},
});