Skip to content

Commit

Permalink
refactor(plugins/rtf-to-txt): improve conciseness of regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Dec 2, 2021
1 parent 64fad0c commit 993f9ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugins/rtf-to-txt/index.js
Expand Up @@ -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) {
/**
Expand Down

0 comments on commit 993f9ad

Please sign in to comment.