Depends on the style guide you’re following, apparently: The AP style guide says space around them[0]. Chicago Manual of Style says not to[1].
0: https://www.prdaily.com/dashes-hyphens-ap-style/ 1: https://www.chicagomanualofstyle.org/qanda/data/faq/topics/H...
Thank you! I usually use THIN SPACE on each side of my em dashes (Compose Space Minus in https://github.com/kragen/xcompose ), but on HN that gets bashed to a regular space.
There’s also the difference between the conventional EU/UK style (spaced en-dash) vs. the common US style (unspaced em-dash).