mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 04:03:57 -06:00
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;
|
||||
}
|
||||
|
||||
if (Quote.REGEXP.test(reply)) {
|
||||
// make it global so we can strip all quotes at once
|
||||
while (Quote.REGEXP.test(reply)) {
|
||||
// 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");
|
||||
reply = reply.replace(regex, "");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user