This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/test/javascripts/helpers/d-editor-helper.js.es6
Joffrey JAFFEUX df95457468
DEV: d-editor helper should be synchronous (#7706)
Also ensures trigger has happened before assertion and prevents leaking formatTextWithSelection into global context
2019-06-05 14:52:38 +02:00

12 lines
218 B
JavaScript

export default function formatTextWithSelection(text, [start, len]) {
return [
'"',
text.substr(0, start),
"<",
text.substr(start, len),
">",
text.substr(start + len),
'"'
].join("");
}