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

Function clearEmptySpans

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

Source from the content-addressed store, hash-verified

6225 // Remove spans that are empty and don't have a clearWhenEmpty
6226 // option of false.
6227 function clearEmptySpans(spans) {
6228 for (var i = 0; i < spans.length; ++i) {
6229 var span = spans[i];
6230 if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)
6231 spans.splice(i--, 1);
6232 }
6233 if (!spans.length) return null;
6234 return spans;
6235 }
6236
6237 // Used for un/re-doing changes from the history. Combines the
6238 // 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