visas – Leaving the US while waiting for an EAD

I have a B1/B2 visa. I want to travel to the US to get married to my spouse (who is a US citizen). Once I get married, we’ll apply for the green card and for the EAD (work permit). I’ve been told that once I apply for the EAD/Work permit I cannot leave the country until I get it. Is that true?

TLDR: Can I leave the United States while waiting for my EAD card/Work permit (with a pending marriage-based green card application)?