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

Function copyableRanges

static/editor.md/lib/codemirror/lib/codemirror.js:1132–1141  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

1130 }
1131
1132 function copyableRanges(cm) {
1133 var text = [], ranges = [];
1134 for (var i = 0; i < cm.doc.sel.ranges.length; i++) {
1135 var line = cm.doc.sel.ranges[i].head.line;
1136 var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};
1137 ranges.push(lineRange);
1138 text.push(cm.getRange(lineRange.anchor, lineRange.head));
1139 }
1140 return {text: text, ranges: ranges};
1141 }
1142
1143 function disableBrowserMagic(field) {
1144 field.setAttribute("autocorrect", "off");

Callers 2

prepareCopyCutFunction · 0.70
onCopyCutFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected