From 00067d012ab73bc0bc8290d08f1e9c924a110e68 Mon Sep 17 00:00:00 2001 From: hacksalot Date: Sat, 3 Feb 2018 16:15:17 -0500 Subject: [PATCH] fix: correctly replace frozen fields in JRS-themed resumes --- dist/renderers/jrs-generator.js | 4 ++-- src/renderers/jrs-generator.coffee | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/renderers/jrs-generator.js b/dist/renderers/jrs-generator.js index 23b1bc8..99baab5 100644 --- a/dist/renderers/jrs-generator.js +++ b/dist/renderers/jrs-generator.js @@ -46,8 +46,8 @@ Definition of the JRSGenerator class. turnoff.forEach(function(c, idx) { return console[c] = org[idx]; }); - return rezHtml = rezHtml.replace(/@@@@~.*?~@@@@/gm, function(val) { - return MDIN(val.replace(/~@@@@/gm, '').replace(/@@@@~/gm, '')); + return rezHtml = rezHtml.replace(/@@@@~[\s\S]*?~@@@@/g, function(val) { + return MDIN(val.replace(/~@@@@/g, '').replace(/@@@@~/g, '')); }); } }; diff --git a/src/renderers/jrs-generator.coffee b/src/renderers/jrs-generator.coffee index 6a39612..6279a3e 100644 --- a/src/renderers/jrs-generator.coffee +++ b/src/renderers/jrs-generator.coffee @@ -37,8 +37,8 @@ JRSGenerator = module.exports = turnoff.forEach (c, idx) -> console[c] = org[idx] # Unfreeze and apply Markdown - rezHtml = rezHtml.replace /@@@@~.*?~@@@@/gm, (val) -> - MDIN( val.replace( /~@@@@/gm,'' ).replace( /@@@@~/gm,'' ) ) + rezHtml = rezHtml.replace /@@@@~[\s\S]*?~@@@@/g, (val) -> + MDIN( val.replace( /~@@@@/g,'' ).replace( /@@@@~/g,'' ) ) MDIN = (txt) -> # TODO: Move this