4

If I create a text, where I got a dash at the start of a word (very common in German language), Google Chrome sets the hyphen at the end of the line and the word at the start of the next line. This is the wrong behavior. It should be the hyphen and the word on one line. Even if I put in a ‍ entity between hyphen and word, it still doesn't work correctly.

In Firefox all is well.

Example here: https://jsfiddle.net/p6dp2hLb/2/

enter image description here

yunzen
  • 32,854
  • 11
  • 73
  • 106
  • I see it all in one line both in Chrome and Firefox. Maybe your browsers language settings? Check with a different computer or over a proxy to make sure – SG_Rowin Jun 01 '16 at 13:40
  • @ShahGhafoori Checked on two Computers. You should change the width of the result frame in jsfiddle example so that a break appears – yunzen Jun 01 '16 at 14:06

2 Answers2

1

You can use ‑ [Unicode Character 'NON-BREAKING HYPHEN' (U+2011)] as an alphabetical character instead of raw dash character because it has its special meanings in formatting.

yunzen
  • 32,854
  • 11
  • 73
  • 106
Ali Sheikhpour
  • 10,475
  • 5
  • 41
  • 82
0

Maybe you can use a hack to get round it?

<span style="white-space: nowrap;">-a</span>

Peter Stock
  • 440
  • 3
  • 13