chore: Move editor into codebase (#2930)
This commit is contained in:
19
shared/editor/nodes/Text.ts
Normal file
19
shared/editor/nodes/Text.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Node as ProsemirrorNode, NodeSpec } from "prosemirror-model";
|
||||
import { MarkdownSerializerState } from "../lib/markdown/serializer";
|
||||
import Node from "./Node";
|
||||
|
||||
export default class Text extends Node {
|
||||
get name() {
|
||||
return "text";
|
||||
}
|
||||
|
||||
get schema(): NodeSpec {
|
||||
return {
|
||||
group: "inline",
|
||||
};
|
||||
}
|
||||
|
||||
toMarkdown(state: MarkdownSerializerState, node: ProsemirrorNode) {
|
||||
state.text(node.text || "", undefined);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user