aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/RichTextRules.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-05-11 17:13:53 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-05-11 17:13:53 -0400
commit7e1f89f48d1c4e49dea78dff1c1983e75a11a6a6 (patch)
tree299080590d960bbb9bef84912a78529e43b1c8ce /src/client/views/nodes/formattedText/RichTextRules.ts
parenta3839d4b5a2180e2e80fa79f6eb4459e2976f380 (diff)
fixed issues with text auto height and scaled documents. allowed #tagging in text notes to support muliple values with ';'. DashFieldviews can have multiple values, too. logout is moved to settings.
Diffstat (limited to 'src/client/views/nodes/formattedText/RichTextRules.ts')
-rw-r--r--src/client/views/nodes/formattedText/RichTextRules.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/views/nodes/formattedText/RichTextRules.ts b/src/client/views/nodes/formattedText/RichTextRules.ts
index d619bc4a0..0ba591fec 100644
--- a/src/client/views/nodes/formattedText/RichTextRules.ts
+++ b/src/client/views/nodes/formattedText/RichTextRules.ts
@@ -11,6 +11,7 @@ import { FormattedTextBox } from "./FormattedTextBox";
import { wrappingInputRule } from "./prosemirrorPatches";
import RichTextMenu from "./RichTextMenu";
import { schema } from "./schema_rts";
+import { List } from "../../../../new_fields/List";
export class RichTextRules {
public Document: Doc;
@@ -64,11 +65,12 @@ export class RichTextRules {
// create an inline view of a tag stored under the '#' field
new InputRule(
- new RegExp(/#([a-zA-Z_\-]+[a-zA-Z_\-0-9]*)\s$/),
+ new RegExp(/#([a-zA-Z_\-]+[a-zA-Z_;\-0-9]*)\s$/),
(state, match, start, end) => {
const tag = match[1];
if (!tag) return state.tr;
- this.Document[DataSym]["#"] = tag;
+ const multiple = tag.split(";");
+ this.Document[DataSym]["#"] = multiple.length > 1 ? new List(multiple) : tag;
const fieldView = state.schema.nodes.dashField.create({ fieldKey: "#" });
return state.tr.deleteRange(start, end).insert(start, fieldView);
}),