Skip to content

Commit

Permalink
Merge branch 'main' into repo-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Octomerger authored Apr 22, 2021
2 parents c80da00 + 7df8df4 commit f69c0fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/liquid-tags/indented-data-reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
this.markup = tagToken.args.trim()
},

async render (context) {
async render (scope) {
// obfuscate first legit space, remove all other spaces, then restore legit space
// this way we can support spaces=NUMBER as well as spaces = NUMBER
const input = this.markup
Expand All @@ -30,7 +30,7 @@ module.exports = {
assert(parseInt(numSpaces) || numSpaces === '0', '"spaces=NUMBER" must include a number')

// Get the referenced value from the context
const value = await this.liquid.evalValue(`site.data.${dataReference}`, context)
const value = await this.liquid.evalValue(`site.data.${dataReference}`, scope)

// If nothing is found in the context, exit with nothing; this may
// feel weird and that we should throw an error, but this is "The Liquid Way TM"
Expand All @@ -39,6 +39,6 @@ module.exports = {
// add spaces to each line
const renderedReferenceWithIndent = value.replace(/^/mg, ' '.repeat(numSpaces))

return this.liquid.parseAndRender(renderedReferenceWithIndent, context)
return this.liquid.parseAndRender(renderedReferenceWithIndent, scope.environments)
}
}

0 comments on commit f69c0fd

Please sign in to comment.