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

Function buildCollapsedSpan

static/editor.md/lib/codemirror/lib/codemirror.js:6857–6870  ·  view source on GitHub ↗
(builder, size, marker, ignoreWidget)

Source from the content-addressed store, hash-verified

6855 }
6856
6857 function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
6858 var widget = !ignoreWidget && marker.widgetNode;
6859 if (widget) builder.map.push(builder.pos, builder.pos + size, widget);
6860 if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {
6861 if (!widget)
6862 widget = builder.content.appendChild(document.createElement("span"));
6863 widget.setAttribute("cm-marker", marker.id);
6864 }
6865 if (widget) {
6866 builder.cm.display.input.setUneditable(widget);
6867 builder.content.appendChild(widget);
6868 }
6869 builder.pos += size;
6870 }
6871
6872 // Outputs a number of spans to make up a line, taking highlighting
6873 // and marked text into account.

Callers 1

insertLineContentFunction · 0.70

Calls 1

setAttributeMethod · 0.45

Tested by

no test coverage detected