aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/RichTextRules.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-04-27 11:10:56 -0400
committerbobzel <zzzman@gmail.com>2023-04-27 11:10:56 -0400
commit66e5fe4d8c4c6fae768305e31b45735f563b7500 (patch)
tree7f917eb0f868c5da8b39c379a5abad99c86de808 /src/client/views/nodes/formattedText/RichTextRules.ts
parent7342eb81f241ce0b2a5a33ddfb0c865eab6a492f (diff)
updated some text shortcuts and enabled selecting regions to make footnoes/elided text.
Diffstat (limited to 'src/client/views/nodes/formattedText/RichTextRules.ts')
-rw-r--r--src/client/views/nodes/formattedText/RichTextRules.ts24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/client/views/nodes/formattedText/RichTextRules.ts b/src/client/views/nodes/formattedText/RichTextRules.ts
index e5943f257..cc19d12bd 100644
--- a/src/client/views/nodes/formattedText/RichTextRules.ts
+++ b/src/client/views/nodes/formattedText/RichTextRules.ts
@@ -8,7 +8,6 @@ import { normalizeEmail } from '../../../../fields/util';
import { Utils } from '../../../../Utils';
import { DocServer } from '../../../DocServer';
import { Docs, DocUtils } from '../../../documents/Documents';
-import { RTFMarkup } from '../../../util/RTFMarkup';
import { FormattedTextBox } from './FormattedTextBox';
import { wrappingInputRule } from './prosemirrorPatches';
import { RichTextMenu } from './RichTextMenu';
@@ -29,7 +28,7 @@ export class RichTextRules {
emDash,
// > blockquote
- wrappingInputRule(/%>\s$/, schema.nodes.blockquote),
+ wrappingInputRule(/%>$/, schema.nodes.blockquote),
// 1. create numerical ordered list
wrappingInputRule(
@@ -191,21 +190,6 @@ export class RichTextRules {
}
}),
- // %f create footnote
- new InputRule(new RegExp(/%f$/), (state, match, start, end) => {
- const newNode = schema.nodes.footnote.create({});
- const tr = state.tr;
- tr.deleteRange(start, end).replaceSelectionWith(newNode); // replace insertion with a footnote.
- return tr.setSelection(
- new NodeSelection( // select the footnote node to open its display
- tr.doc.resolve(
- // get the location of the footnote node by subtracting the nodesize of the footnote from the current insertion point anchor (which will be immediately after the footnote node)
- tr.selection.anchor - (tr.selection.$anchor.nodeBefore?.nodeSize || 0)
- )
- )
- );
- }),
-
// activate a style by name using prefix '%<color name>'
new InputRule(new RegExp(/%[a-z]+$/), (state, match, start, end) => {
const color = match[0].substring(1, match[0].length);
@@ -229,12 +213,6 @@ export class RichTextRules {
return null;
}),
- // show markup help
- new InputRule(new RegExp(/%\?$/), (state, match, start, end) => {
- setTimeout(RTFMarkup.Instance.open);
- return state.tr.deleteRange(start, end);
- }),
-
// stop using active style
new InputRule(new RegExp(/%alt$/), (state, match, start, end) => {
setTimeout(() => (this.Document[this.TextBox.props.fieldKey + '-usePath'] = this.Document[this.TextBox.props.fieldKey + '-usePath'] ? undefined : 'alternate'));