@matratype @samebchase looks like all style guides except the AP ask you to omit spaces around the em dash 🤷🏽♀️
also, i just realized that putting spaces around the em dash can affect how the text is soft-wrapped on narrow viewports.
i did some testing. browsers seem to not care about this at all, treating the em dash like any other punctuation. doesn't matter whether you add spaces around them or not, the result is the same. native macOS apps (Pages etc.) don't care either.
in all these apps, two words with an em dash in between are placed on different lines when the viewport is too narrow to fit all of them. the dash can stick to the first word or the second, based on available space. spaces don't make a difference.
Microsoft Word seems to treat two words joined by an em dash as a single unit. when wrapping text, it always keeps them together on a single line. but if you put spaces around the em dash, it behaves like any other browser/macOS app.