Skip to content

Commit 1cd1aac

Browse files
authored
Merge pull request #5638 from github/repo-sync
repo sync
2 parents c80da00 + 1147407 commit 1cd1aac

3 files changed

Lines changed: 8 additions & 8 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
}

lib/render-content/create-processor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = function createProcessor (context) {
2727
.use(highlight, { languages: { graphql }, subset: false })
2828
.use(raw)
2929
.use(rewriteLegacyAssetPaths, context)
30-
.use(wrapInElement, { selector: 'ol > li img', wrapper: 'div.procedural-image-wrapper' })
30+
.use(wrapInElement, { selector: 'ol > li img', wrapper: 'span.procedural-image-wrapper' })
3131
.use(rewriteLocalLinks, { languageCode: context.currentLanguage, version: context.currentVersion })
3232
.use(html)
3333
}

lib/render-content/plugins/wrap-in-element.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ module.exports = options => {
2222
throw new TypeError('Expected a `string` as selector')
2323
}
2424

25-
for (const match of selectAll(options.selector, tree)) {
25+
for (const match of selectAll(selector, tree)) {
2626
visit(tree, match, (node, i, parent) => {
27-
const wrapper = parseSelector('div')
28-
wrapper.children = [node]
29-
parent.children[i] = wrapper
27+
const parsedWrapper = parseSelector(wrapper)
28+
parsedWrapper.children = [node]
29+
parent.children[i] = parsedWrapper
3030
})
3131
}
3232
}

0 commit comments

Comments
 (0)