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

Function clearEmptySpans

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

Source from the content-addressed store, hash-verified

6427 // Remove spans that are empty and don't have a clearWhenEmpty
6428 // option of false.
6429 function clearEmptySpans(spans) {
6430 for (var i = 0; i < spans.length; ++i) {
6431 var span = spans[i];
6432 if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)
6433 spans.splice(i--, 1);
6434 }
6435 if (!spans.length) return null;
6436 return spans;
6437 }
6438
6439 // Used for un/re-doing changes from the history. Combines the
6440 // result of computing the existing spans with the set of spans that

Callers 1

stretchSpansOverChangeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected