mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Got callouts about working, simplified markdown setup
This commit is contained in:
15
resources/js/editor/markdown-serializer.js
Normal file
15
resources/js/editor/markdown-serializer.js
Normal file
@ -0,0 +1,15 @@
|
||||
import {MarkdownSerializer, defaultMarkdownSerializer} from "prosemirror-markdown";
|
||||
import {docToHtml} from "./util";
|
||||
|
||||
const nodes = defaultMarkdownSerializer.nodes;
|
||||
const marks = defaultMarkdownSerializer.marks;
|
||||
|
||||
nodes.callout = function(state, node) {
|
||||
const html = docToHtml({ content: [node] });
|
||||
state.write(html);
|
||||
state.closeBlock();
|
||||
};
|
||||
|
||||
const serializer = new MarkdownSerializer(nodes, marks);
|
||||
|
||||
export default serializer;
|
Reference in New Issue
Block a user