mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
String.prototype.substr() is deprecated so we replace it with String.prototype.slice() which works similarily but isn't deprecated. Signed-off-by: Tobias Speicher <[email protected]> Co-authored-by: Jarek Radosz <[email protected]>
12 lines
224 B
JavaScript
12 lines
224 B
JavaScript
export default function formatTextWithSelection(text, [start, len]) {
|
|
return [
|
|
'"',
|
|
text.slice(0, start),
|
|
"<",
|
|
text.slice(start, start + len),
|
|
">",
|
|
text.slice(start + len),
|
|
'"',
|
|
].join("");
|
|
}
|