What if they do `<body class="foo">` in their document?  Can you use something like `/\<body([^>]*)\>/` and grab whatever trails the body element name, copying it across into what you inject?