From 993f9ade7641958d43987aababab8589f18150ac Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Thu, 2 Dec 2021 11:11:23 +0000 Subject: [PATCH] refactor(plugins/rtf-to-txt): improve conciseness of regex --- src/plugins/rtf-to-txt/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/rtf-to-txt/index.js b/src/plugins/rtf-to-txt/index.js index dd8c191b2..7dc0381a3 100644 --- a/src/plugins/rtf-to-txt/index.js +++ b/src/plugins/rtf-to-txt/index.js @@ -86,7 +86,10 @@ async function plugin(server, options) { // Remove metadata comments UnRTF adds to beginning of file req.conversionResults.body = req.conversionResults.body - .replace(/^###(?:\s){0,3}.*?(?:-){1,17}/ms, "") + .replace( + /^###\s?Translation\s?from\s?RTF\s?performed\s?by\s?UnRTF.*?-{1,17}/ims, + "" + ) .trim(); } catch (err) { /**