diff options
author | bobzel <zzzman@gmail.com> | 2023-04-24 15:47:37 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-04-24 15:47:37 -0400 |
commit | ec8a635f7fadf7a25b38f0be757ff5ae010bb417 (patch) | |
tree | 4783d2dd916c1b538fe2d18c242403dc0ace3b9a /src | |
parent | e4c7926a5280222156a38d46a2aa87d442712cf1 (diff) |
added text rule for switching to alternate text.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/formattedText/RichTextRules.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/views/nodes/formattedText/RichTextRules.ts b/src/client/views/nodes/formattedText/RichTextRules.ts index e691869cc..0ca6b415f 100644 --- a/src/client/views/nodes/formattedText/RichTextRules.ts +++ b/src/client/views/nodes/formattedText/RichTextRules.ts @@ -5,7 +5,7 @@ import { Id } from '../../../../fields/FieldSymbols'; import { ComputedField } from '../../../../fields/ScriptField'; import { NumCast, StrCast } from '../../../../fields/Types'; import { normalizeEmail } from '../../../../fields/util'; -import { returnFalse, Utils } from '../../../../Utils'; +import { Utils } from '../../../../Utils'; import { DocServer } from '../../../DocServer'; import { Docs, DocUtils } from '../../../documents/Documents'; import { FormattedTextBox } from './FormattedTextBox'; @@ -229,6 +229,12 @@ export class RichTextRules { }), // 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')); + return state.tr.deleteRange(start, end); + }), + + // stop using active style new InputRule(new RegExp(/%%$/), (state, match, start, end) => { const tr = state.tr.deleteRange(start, end); const marks = state.tr.selection.$anchor.nodeBefore?.marks; |