No Node.setAttrs?

The Node API has .copy to make a new node with different content, .mark for different marks, but nothing for different attrs.

In fact I think the only way to do this with the public API is a round-trip through JSON. Is that right?

Would you accept a PR adding .setAttrs @marijn? And how about one for a public constructor?

Is there some subtlety that complicates this?

Doh! Of course the constructors are the nodeType.create methods.

So, given the immutability, I think it’s OK to do

oldNode.type.create(newAttrs, oldNode.content, oldNode.marks)

Right?

.setAttrs could still be a nice convenience to add…