I finally figured it out. On this page, there is code to disable the replacements. Not knowing anything about PHP, I didn’t know where to put it.
https://ww.wp.xz.cn/support/topic/removing-emdash-replacement?replies=10
The code is:
remove_filter ('the_content', 'wptexturize');
remove_filter ('comment_text', 'wptexturize');
remove_filter ('single_post_title', 'wptexturize');
remove_filter ('the_title', 'wptexturize');
remove_filter ('the_excerpt', 'wptexturize');
This code is added to the bottom of the functions.php file in /wp-content/themes/(name of theme)/