Personal no-bs blogging platform.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334import { inputRules, textblockTypeInputRule, wrappingInputRule } from "prosemirror-inputrules";import { schema } from "prosemirror-markdown";
export const headingRule = textblockTypeInputRule( /^(#{1,6})\s$/, schema.nodes.heading, match => ({ level: match[1]!.length }));
export const blockquoteRule = wrappingInputRule( /^\>\s$/, schema.nodes.blockquote);
export const unorderedListRule = wrappingInputRule( /^\-\s$/, schema.nodes.bullet_list);
export const orderedListRule = wrappingInputRule( /^1\.\s$/, schema.nodes.ordered_list);
export const rules = inputRules({ rules: [ headingRule, blockquoteRule, unorderedListRule, orderedListRule, ],});