Add an explicit non-breaking space before "with" in template

This fixes #8195.