MCPcopy Create free account
hub / github.com/TruthHun/BookStack / removeClearedSpans

Function removeClearedSpans

static/mergely/lib/codemirror.js:8014–8021  ·  view source on GitHub ↗
(spans)

Source from the content-addressed store, hash-verified

8012 // When un/re-doing restores text containing marked spans, those
8013 // that have been explicitly cleared should not be restored.
8014 function removeClearedSpans(spans) {
8015 if (!spans) return null;
8016 for (var i = 0, out; i < spans.length; ++i) {
8017 if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }
8018 else if (out) out.push(spans[i]);
8019 }
8020 return !out ? spans : out.length ? out : null;
8021 }
8022
8023 // Retrieve and filter the old marked spans stored in a change event.
8024 function getOldSpans(doc, change) {

Callers 1

getOldSpansFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected