Not sure how much of a performance penalty this would be when considering everything else that's going on, but I guess an alternative to above would be to do the original replace, but call the following function for replacement:
```
function(m, s1, s2) {
  if(/\\[a-z]/.test(s1)) s1 += ' ';
  return '{' + s1 + s2 + '}';
}
```
which may or may not be faster. Just a thought.