Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
}
2 changes: 1 addition & 1 deletion lib/render-content/create-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function createProcessor (context) {
.use(highlight, { languages: { graphql }, subset: false })
.use(raw)
.use(rewriteLegacyAssetPaths, context)
.use(wrapInElement, { selector: 'ol > li img', wrapper: 'div.procedural-image-wrapper' })
.use(wrapInElement, { selector: 'ol > li img', wrapper: 'span.procedural-image-wrapper' })
.use(rewriteLocalLinks, { languageCode: context.currentLanguage, version: context.currentVersion })
.use(html)
}
8 changes: 4 additions & 4 deletions lib/render-content/plugins/wrap-in-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ module.exports = options => {
throw new TypeError('Expected a `string` as selector')
}

for (const match of selectAll(options.selector, tree)) {
for (const match of selectAll(selector, tree)) {
visit(tree, match, (node, i, parent) => {
const wrapper = parseSelector('div')
wrapper.children = [node]
parent.children[i] = wrapper
const parsedWrapper = parseSelector(wrapper)
parsedWrapper.children = [node]
parent.children[i] = parsedWrapper
})
}
}
Expand Down