As for plain text, I follow LaTeX conventions (and some Markdown flavours) in which a single '-' is a hyphen, a doubled '--' is an en-dash (used for numeric ranges, e.g., 1917--1991), and a triple dash '---' indicates an em dash.
Put spaces around your em dashes. Real human readers will thank you.
Style guides are bullshit on this point.
Checking just now, the AP style guide does specify spaces around em dashes, so if you want a justification, claim you're using AP ems.
<https://www.thepunctuationguide.com/em-dash.html>
See also Merriam-Webster's guidance, though MW fall to the Dark Side:
<https://www.merriam-webster.com/words-at-play/em-dash-en-das...>
As for plain text, I follow LaTeX conventions (and some Markdown flavours) in which a single '-' is a hyphen, a doubled '--' is an en-dash (used for numeric ranges, e.g., 1917--1991), and a triple dash '---' indicates an em dash.
Put spaces around your em dashes. Real human readers will thank you.
As well as the stray space alien cat.