DEV: improvement to stripping quote logic
Followup one afc7830b
we needed handling for nested quotes
This commit is contained in:
parent
afc7830be5
commit
741d5bf541
|
@ -451,8 +451,9 @@ const Composer = RestModel.extend({
|
||||||
return reply.length;
|
return reply.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Quote.REGEXP.test(reply)) {
|
while (Quote.REGEXP.test(reply)) {
|
||||||
// make it global so we can strip all quotes at once
|
// make it global so we can strip as many quotes at once
|
||||||
|
// keep in mind nested quotes mean we still need a loop here
|
||||||
const regex = new RegExp(Quote.REGEXP.source, "img");
|
const regex = new RegExp(Quote.REGEXP.source, "img");
|
||||||
reply = reply.replace(regex, "");
|
reply = reply.replace(regex, "");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue