diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-06-22 17:46:02 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-06-22 17:46:02 -0400 |
commit | 6017e76469bd820dabdef4e0cab6fbb6c3a988ad (patch) | |
tree | fcba292f09718e689c726611ad91eab9dd750006 /src | |
parent | d5b0995f823f8e125c967edbd474bb2c7f106168 (diff) |
fixed text input rule for bullets by typing: "- "
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/formattedText/RichTextRules.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/client/views/nodes/formattedText/RichTextRules.ts b/src/client/views/nodes/formattedText/RichTextRules.ts index e442149d6..ba3230801 100644 --- a/src/client/views/nodes/formattedText/RichTextRules.ts +++ b/src/client/views/nodes/formattedText/RichTextRules.ts @@ -59,7 +59,16 @@ export class RichTextRules { ), // * + - create bullet list - wrappingInputRule(/^\s*([-+*])\s$/, schema.nodes.ordered_list), + wrappingInputRule(/^\s*([-+*])\s$/, schema.nodes.ordered_list, + // match => { + () => { + return ({ mapStyle: "bullet" }); + // return ({ order: +match[1] }) + }, + (match: any, node: any) => { + return node.childCount + node.attrs.order === +match[1]; + }, + (type: any) => ({ type: type, attrs: { mapStyle: "bullet" } })), // ``` create code block textblockTypeInputRule(/^```$/, schema.nodes.code_block), |