Skip to content

Commit 7df8df4

Browse files
authored
Merge pull request #18937 from github/indented-data-ref-parsing
Parse Liquid inside indented data tags
2 parents 92c8274 + 7a8cccf commit 7df8df4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/liquid-tags/indented-data-reference.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
this.markup = tagToken.args.trim()
1515
},
1616

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

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

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

42-
return this.liquid.parseAndRender(renderedReferenceWithIndent, context)
42+
return this.liquid.parseAndRender(renderedReferenceWithIndent, scope.environments)
4343
}
4444
}

0 commit comments

Comments
 (0)