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

Function collapsedSpanAtSide

static/editor.md/lib/codemirror/lib/codemirror.js:6328–6337  ·  view source on GitHub ↗
(line, start)

Source from the content-addressed store, hash-verified

6326 // Find out whether a line ends or starts in a collapsed span. If
6327 // so, return the marker for that span.
6328 function collapsedSpanAtSide(line, start) {
6329 var sps = sawCollapsedSpans && line.markedSpans, found;
6330 if (sps) for (var sp, i = 0; i < sps.length; ++i) {
6331 sp = sps[i];
6332 if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&
6333 (!found || compareCollapsedMarkers(found, sp.marker) < 0))
6334 found = sp.marker;
6335 }
6336 return found;
6337 }
6338 function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); }
6339 function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); }
6340

Callers 2

collapsedSpanAtStartFunction · 0.70
collapsedSpanAtEndFunction · 0.70

Calls 1

compareCollapsedMarkersFunction · 0.70

Tested by

no test coverage detected