MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / insert

Function insert

static/scripts/markitup/jquery.markitup.js:359–366  ·  view source on GitHub ↗
(block)

Source from the content-addressed store, hash-verified

357
358 // add markup
359 function insert(block) {
360 if (document.selection) {
361 var newSelection = document.selection.createRange();
362 newSelection.text = block;
363 } else {
364 $$.val($$.val().substring(0, caretPosition) + block + $$.val().substring(caretPosition + selection.length, $$.val().length));
365 }
366 }
367
368 // set a selection
369 function set(start, len) {

Callers 1

markupFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected