The parsed selector nodes for nesting with parenthesis, e.g. &(:focus) end up coming out in the parsed node with the parens attached to the ampersand. So we have to clone the parent node, and then inject the parens back into the last selector in the cloned parent node.
Let me know if I'm missing something, but this seems to work.
This is the cleanest fix I could come up with.
The parsed selector nodes for nesting with parenthesis, e.g. &(:focus) end up coming out in the parsed node with the parens attached to the ampersand. So we have to clone the parent node, and then inject the parens back into the last selector in the cloned parent node.
Let me know if I'm missing something, but this seems to work.