aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/ProsemirrorExampleTransfer.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-08-27 10:27:50 -0400
committerbob <bcz@cs.brown.edu>2019-08-27 10:27:50 -0400
commit2b1035aa307a0cea6076030822cd5bb3c9793fb4 (patch)
treedb41afd8c5e17d58b89f69fb5a8b35c2d3e66b98 /src/client/util/ProsemirrorExampleTransfer.ts
parentd31999dd3fce11a886bd402c27f34c35c7c85935 (diff)
last refinements for now.
Diffstat (limited to 'src/client/util/ProsemirrorExampleTransfer.ts')
-rw-r--r--src/client/util/ProsemirrorExampleTransfer.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client/util/ProsemirrorExampleTransfer.ts b/src/client/util/ProsemirrorExampleTransfer.ts
index 4ca19eff1..8b6936748 100644
--- a/src/client/util/ProsemirrorExampleTransfer.ts
+++ b/src/client/util/ProsemirrorExampleTransfer.ts
@@ -104,6 +104,14 @@ export default function buildKeymap<S extends Schema<any>>(schema: S, mapKeys?:
let sxf = state.tr.setSelection(TextSelection.create(state.doc, range!.start, range!.end));
let newstate = state.applyTransaction(sxf);
if (!wrapInList(schema.nodes.ordered_list)(newstate.state, (tx2: Transaction) => {
+ const resolvedPos = tx2.doc.resolve(Math.round((range!.start + range!.end) / 2));
+ let path = (resolvedPos as any).path as any;
+ for (let i = path.length - 1; i > 0; i--) {
+ if (path[i].type === schema.nodes.ordered_list) {
+ path[i].attrs.bulletStyle = nodeTypeMark(depth);
+ break;
+ }
+ }
marks && tx2.ensureMarks([...marks]);
marks && tx2.setStoredMarks([...marks]);