shellscape/postcss-values-parser

Node.replaceWith() within a function removes preceding spaces

Closed this issue · 0 comments

nex3 commented
  • Operating System (or Browser): RunKit
  • Node Version: 10.18.0
  • postcss-values-parser Version: 3.0.5

How Do We Reproduce?

https://runkit.com/nex3/5e2ec2c236cf0f001ac9f9ab

var {parse} = require("postcss-values-parser")

var result = parse("fn(foo bar)");
result.nodes[0].nodes[1].replaceWith(parse("baz"));
result.toString();

Expected Behavior

This should return "fn(foo bar)".

Actual Behavior

It returns "fn(foobar)".