Skip to content

Commit

Permalink
fix(jekyll/eleventy): multiline assign tags now render correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
bglw committed Mar 3, 2022
1 parent 1e5b979 commit 2756be2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}<!--bookshop-live context(${identifier}: ${value})-->`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}<!--bookshop-live context(${identifier}: ${value})-->`
}

Expand Down

0 comments on commit 2756be2

Please sign in to comment.