Open GavinRay97 opened 5 years ago
In stringify.js, mods.block is hardcoded to curlies.
stringify.js
mods.block
curlies
If the argument signature is changed to:
const stringify = (node, options = { depth: 0, syntax: 'css' }) => {
and the mod declaration moved inside of the stringify closure, with one additional change made to buffer = node.children.reduce() so that it is
mod
stringify
buffer = node.children.reduce()
buffer = node.children.reduce( (buff, child) => buff.concat( stringify(child, { depth: options.depth + 1, syntax: options.syntax }), // <-- PASSING OPTS HERE ), [], )
Then we change mods.block
const mods = { 'block': (options.syntax != 'sass') && curlies, // etc }
The issue is resolved.
const sassAST = sast.parse(mockSASS, {syntax: 'sass'}) sast.stringify(sassAST, {syntax: 'sass'})
I can submit PR for this tomorrow.
In
stringify.js
,mods.block
is hardcoded tocurlies
.If the argument signature is changed to:
and the
mod
declaration moved inside of thestringify
closure, with one additional change made tobuffer = node.children.reduce()
so that it isThen we change
mods.block
The issue is resolved.
I can submit PR for this tomorrow.