From 2756be2e68424c4e2acafe1e46bc04e9e1cc614c Mon Sep 17 00:00:00 2001 From: Liam Bigelow Date: Thu, 3 Mar 2022 15:08:00 +1300 Subject: [PATCH] fix(jekyll/eleventy): multiline assign tags now render correctly --- .../engines/eleventy-engine/lib/translateLiquid.js | 2 +- javascript-modules/engines/jekyll-engine/lib/translateLiquid.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript-modules/engines/eleventy-engine/lib/translateLiquid.js b/javascript-modules/engines/eleventy-engine/lib/translateLiquid.js index 00775926..0f84daaa 100644 --- a/javascript-modules/engines/eleventy-engine/lib/translateLiquid.js +++ b/javascript-modules/engines/eleventy-engine/lib/translateLiquid.js @@ -25,7 +25,7 @@ const rewriteTag = function (token, src, liveMarkup) { } if (liveMarkup && token.name && (token.name === 'assign' || token.name === 'local')) { - let [, identifier, value] = token.args.match(/^\s*([^=]+?)\s*=\s*(.+?)\s*$/); + let [, identifier, value] = token.args.match(/^[\r\n\s]*([^=]+?)[\r\n\s]*=[\r\n\s]*([\s\S]+?)[\r\n\s]*$/); raw = `${raw}` } diff --git a/javascript-modules/engines/jekyll-engine/lib/translateLiquid.js b/javascript-modules/engines/jekyll-engine/lib/translateLiquid.js index a55b764f..06800fd2 100644 --- a/javascript-modules/engines/jekyll-engine/lib/translateLiquid.js +++ b/javascript-modules/engines/jekyll-engine/lib/translateLiquid.js @@ -15,7 +15,7 @@ const rewriteTag = function (token, src, liveMarkup) { } if (liveMarkup && token.name && (token.name === 'assign' || token.name === 'local')) { - let [, identifier, value] = token.args.match(/^\s*([^=]+?)\s*=\s*(.+?)\s*$/); + let [, identifier, value] = token.args.match(/^[\r\n\s]*([^=]+?)[\r\n\s]*=[\r\n\s]*([\s\S]+?)[\r\n\s]*$/); raw = `${raw}` }