yunzen
yunzen

Reputation: 33439

Chrome doesn't respect Zero Width Joiner

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

Upvotes: 4

Views: 1032

Answers (2)

Ali Sheikhpour
Ali Sheikhpour

Reputation: 11086

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.

Upvotes: 1

Peter Stock
Peter Stock

Reputation: 450

Maybe you can use a hack to get round it?

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

Upvotes: 0

Related Questions