allow escaping the first slash to not write a command
This commit is contained in:
parent
5565eca0cb
commit
712c3e5450
2 changed files with 15 additions and 1 deletions
|
@ -74,3 +74,16 @@ export function stripEmoteCommand(model) {
|
|||
model.removeText({index: 0, offset: 0}, 4);
|
||||
return model;
|
||||
}
|
||||
|
||||
export function unescapeMessage(model) {
|
||||
const {parts} = model;
|
||||
if (parts.length) {
|
||||
const firstPart = parts[0];
|
||||
// only unescape \/ to / at start of editor
|
||||
if (firstPart.type === "plain" && firstPart.text.startsWith("\\/")) {
|
||||
model = model.clone();
|
||||
model.removeText({index: 0, offset: 0}, 1);
|
||||
}
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue