mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 06:40:23 +08:00
df95457468
Also ensures trigger has happened before assertion and prevents leaking formatTextWithSelection into global context
12 lines
218 B
JavaScript
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("");
|
|
}
|