Wikipedia talk:Non-breaking hyphen

Latest comment: 9 years ago by Milkunderwood in topic Code for non-breaking hyphen
WikiProject iconEssays Mid‑impact
WikiProject iconThis page is within the scope of WikiProject Wikipedia essays, a collaborative effort to organise and monitor the impact of Wikipedia essays. If you would like to participate, please visit the project page, where you can join the discussion. For a listing of essays see the essay directory.
MidThis page has been rated as Mid-impact on the project's impact scale.
Note icon
The above rating was automatically assessed using data on pageviews, watchers, and incoming links.

Code for non-breaking hyphen edit

I had to add a "#" following the "&" to make this code work. But the result does not look like a keyed hyphen - it's too short, and sits too high. This is what it looks like: "‑", and here's a hyphen: "-". And next to each other: ‑ -. Does anyone know the correct code for a true non-breaking hyphen? Milkunderwood (talk) 07:22, 30 June 2014 (UTC)Reply

This is a "true" non-breaking hyphen. The fact that it may look different is entirely dependent on what font is being used; if your default font does not contain a certain character, it will use a font that does. -- [[User:Edokter]] {{talk}} 08:45, 30 June 2014 (UTC)Reply
Thanks for the clarification. Also, this discussion, copied from the Help desk:
  • "Hm... Hunting around online, 8209 is the HTML for what's considered to be a non-breaking "hyphen". I might do better filling the line with FFs and forcing the part before the hyphen down to the next line - but then you run into display problems where the break occurs in different places. So I guess 8209 is the only (albeit bad) solution. I tried "<nobr>-</nobr>" but this doesn't work here. Just out of curiosity, does the too-high and too-short 8209 character have a name, since it's a kludge rather than a real hyphen? Milkunderwood (talk) 09:14, 30 June 2014 (UTC)Reply
  • "The whole area is a bit of a mess. The thing on your keyboard next to the zero key is actually a hyphen-minus (Unicode U+002D), and not (typographically) either a proper hyphen (U+2010) or a minus (U+2212). Subject to the vagaries of the fonts you have installed, you should see that &$8208; (the "real" U+2010 hyphen) has the same appearance as &$8209; (U+2011) non-breaking hyphen. Of course that doesn't help because the rest of the text is probably full of hyphen-minuses and the two characters will look odd close to each other. AFAIK, there is no non-breaking hyphen-minus. A partial solution is to use the nowrap template, something like this: {{nowrap|first-second}}, which should render as a pair of words, "first-second" that won't be subject to word-wrapping. Rwessel (talk) 09:06, 30 June 2014 (UTC)Reply
  • "The "nowrap" template does the trick for me - that completely solves my problem. Thanks very much. Milkunderwood (talk) 09:26, 30 June 2014 (UTC)"Reply
  •   Resolved