diff options
| author | bobzel <zzzman@gmail.com> | 2020-09-17 10:46:27 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-09-17 10:46:27 -0400 |
| commit | 80bbbb3842cb89949d2b949ce8f5a2ed3921b112 (patch) | |
| tree | 0041374a63f80325060a47dc0a259c750e526792 /src/client/views/nodes/formattedText/prosemirrorPatches.js | |
| parent | 5dc5009da8018d79620a42b75833d5b4335e0f56 (diff) | |
fixed deleting text links to work when there are multiple links in the same linkAnchor mark. addressed problem with text getting a negative height when its resized to fit content in a preview window when its also displayed in freeform.
Diffstat (limited to 'src/client/views/nodes/formattedText/prosemirrorPatches.js')
| -rw-r--r-- | src/client/views/nodes/formattedText/prosemirrorPatches.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/views/nodes/formattedText/prosemirrorPatches.js b/src/client/views/nodes/formattedText/prosemirrorPatches.js index 0969ea4ef..746c93868 100644 --- a/src/client/views/nodes/formattedText/prosemirrorPatches.js +++ b/src/client/views/nodes/formattedText/prosemirrorPatches.js @@ -146,7 +146,9 @@ function isInSetWithAttrs(mark, set, attrs) { for (var i = 0; i < set.length; i++) { if (set[i].type == mark) { if (Array.from(Object.keys(attrs)).reduce((p, akey) => { - return p && JSON.stringify(set[i].attrs[akey]) === JSON.stringify(attrs[akey]); + if (p && JSON.stringify(set[i].attrs[akey]) === JSON.stringify(attrs[akey])) return true; + set[i].attrs.allLinks = Array.from(set[i].attrs.allLinks).filter(a => !Array.from(attrs.allLinks.map(al => al.targetId)).includes(a.targetId) || !Array.from(attrs.allLinks.map(al => al.linkId).includes(a.linkId))) + return false; }, true)) { return set[i]; } @@ -178,7 +180,7 @@ function removeMarkWithAttrs(tr, from, to, mark, attrs) { var style = toRemove[i], found$1 = (void 0); for (var j = 0; j < matched.length; j++) { var m = matched[j]; - if (m.step == step - 1 && style.eq(matched[j].style)) { found$1 = m; } + if (m.step == step - 1 /*&& style.eq(matched[j].style)*/) { found$1 = m; } // bcz: not sure what this is even trying to do, but style.eq doesn't seem to exist anymore } if (found$1) { found$1.to = end; |
