aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/RichTextRules.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-10-08 14:26:38 -0400
committerbob <bcz@cs.brown.edu>2019-10-08 14:26:38 -0400
commit121cbc76bf971e688398533b303e32d637265364 (patch)
treed4a19625e2002cdfa93c1a240b41d22f8e951ce6 /src/client/util/RichTextRules.ts
parent84211163c9f085a521b3ca3af0dc9103640e3622 (diff)
added ignore items markup
Diffstat (limited to 'src/client/util/RichTextRules.ts')
-rw-r--r--src/client/util/RichTextRules.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/util/RichTextRules.ts b/src/client/util/RichTextRules.ts
index 346d5ab99..ebb9bda8a 100644
--- a/src/client/util/RichTextRules.ts
+++ b/src/client/util/RichTextRules.ts
@@ -72,13 +72,20 @@ export const inpRules = {
return state.tr.deleteRange(start, end).addStoredMark(schema.marks.pFontSize.create({ fontSize: Number(match[1]) }));
}),
new InputRule(
- new RegExp(/\t/),
+ new RegExp(/t/),
(state, match, start, end) => {
if (state.selection.to === state.selection.from) return null;
let node = (state.doc.resolve(start) as any).nodeAfter;
return node ? state.tr.addMark(start, end, schema.marks.user_tag.create({ userid: Doc.CurrentUserEmail, tag: "todo", modified: Math.round(Date.now() / 1000 / 60) })) : state.tr;
}),
new InputRule(
+ new RegExp(/i/),
+ (state, match, start, end) => {
+ if (state.selection.to === state.selection.from) return null;
+ let node = (state.doc.resolve(start) as any).nodeAfter;
+ return node ? state.tr.addMark(start, end, schema.marks.user_tag.create({ userid: Doc.CurrentUserEmail, tag: "ignore", modified: Math.round(Date.now() / 1000 / 60) })) : state.tr;
+ }),
+ new InputRule(
new RegExp(/\!/),
(state, match, start, end) => {
if (state.selection.to === state.selection.from) return null;