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

Function removeClearedSpans

static/editor.md/lib/codemirror/lib/codemirror.js:7783–7790  ·  view source on GitHub ↗
(spans)

Source from the content-addressed store, hash-verified

7781 // When un/re-doing restores text containing marked spans, those
7782 // that have been explicitly cleared should not be restored.
7783 function removeClearedSpans(spans) {
7784 if (!spans) return null;
7785 for (var i = 0, out; i < spans.length; ++i) {
7786 if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }
7787 else if (out) out.push(spans[i]);
7788 }
7789 return !out ? spans : out.length ? out : null;
7790 }
7791
7792 // Retrieve and filter the old marked spans stored in a change event.
7793 function getOldSpans(doc, change) {

Callers 1

getOldSpansFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected