Yes, Virginia, there IS a non-breaking hyphen, Unicode U+2011, or (in an HTML document)
Unlike an ordinary hyphen, this one will not allow a browser-inserted line break immediately following it. This is easier with non-breaking spaces; you just use the entity name
in your HTML document, and the browser inserts it for you. But with hyphens, to prevent an untimely line break, you have to use the non-breaking hyphen character. There’s apparently no easy entity name for it; use the code above directly in the HTML, or copy-paste it as described below.
If you forget its Unicode character number, or if you’re not fond of messing with HTML, you can search your character map for “NON-BREAKING HYPHEN” and copy-paste what it finds. I have tested the resulting character in the current Firefox and Google Chrome browsers; it works in both.
Why, oh why is this not universally known? I’ve been looking for such a thing for several years, and only today did Google search turn up something useful.
ASIDE: if you try to copy and paste the code for the non-breaking hyphen above near the top of the post, you will find that when you paste it, it may or may not work, depending on the editor you’re working in… e.g., Linux folks will find it does not work in
gedit, but works in the WordPress editor. That’s because there’s an additional invisible character in the above example between the & and the # known as a “zero-width joiner.” I had to insert it to overcome WordPress’s insistence on interpreting the ampersand‑”amp”‑semicolon as a literal ampersand in that context only. I do not know why it does that; I do not believe it is correct… but I had to insert the zero-width joiner to get WordPress to display the code properly. Your best bet is to type the code manually:
Be sure the ‘x’ is lower case.
Or just use the Character Map (same name in Windows and Linux) and forget about HTML.