I know that getPathToNode is only used in editing, but I think it belongs conceptually with sharedMkHTML. The main secret (i.e., design decision) that getPathToNode depends on is the use of the data-childNumber attribute to encode path information; and this is a secret that conceptually belongs to sharedMkHTML more than anywhere else. It is true that we haven't hidden this design decision very well. You can find references to the data-childNumber attribute in all the top-level modules. But moving the function to sharedMkHTML makes that problem worse instead of better.
I know that getPathToNode is only used in editing, but I think it belongs conceptually with sharedMkHTML. The main secret (i.e., design decision) that getPathToNode depends on is the use of the data-childNumber attribute to encode path information; and this is a secret that conceptually belongs to sharedMkHTML more than anywhere else. It is true that we haven't hidden this design decision very well. You can find references to the data-childNumber attribute in all the top-level modules. But moving the function to sharedMkHTML makes that problem worse instead of better.
So I'd say, let's not do this.