Herpes in utero

Can baby get HSV 2 in utero if you have continuous outbreaks? I am having a planned c section because of this but worry he may still contract it while I’m pregnant.