From f467521e96db8a5624a72e62afb9ec591568dda7 Mon Sep 17 00:00:00 2001 From: Daniel Glus Date: Sat, 27 Jul 2019 01:29:54 -0700 Subject: [PATCH] nasty hack to fix comment cleanup --- src/modules/submissions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/submissions.js b/src/modules/submissions.js index b20e959..b582f27 100644 --- a/src/modules/submissions.js +++ b/src/modules/submissions.js @@ -596,7 +596,9 @@ this.text = this.text.replace( new RegExp( '\\{\\{\\s*afc submission\\s*(?:\\||[^{{}}]*|{{.*?}})*?\\}\\}' + // Also remove the AFCH-generated warning message, since if necessary the script will add it again '( )?', 'gi' ), '' ); - this.text = this.text.replace( /\{\{\s*afc comment\s*(?:\||[^{{}}]*|{{.*?}})*?\}\}/gi, '' ); + + // Nastiest hack of all time. As above, Parsoid would be great. Gotta wire it up asynchronously first, though. + this.text = this.text.replace( /\{\{\s*afc comment.+?\(UTC\)\}\}/gi, '' ); // Remove horizontal rules that were added by AFCH after the comments this.text = this.text.replace( /^----+$/gm, '' );