Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dealing with Korean text breaking words

I am building a website where I am displaying korean text. The client (US local) is being very unhappy because the text is breaking in the middle of words. As example of this, here is an image: Red background text being one word.

enter image description here

I have tried to use

word-break: keep-all;

but it isn't supported in Chrome/Safari.

What am I able to do? I have searched the web for hours and got nothing. Is this something that is expected in cjk sites or is there a solution that I haven't found.

It is a responsive site, so I can't put in hard breaks, or fake it.

demo: http://codepen.io/cibgraphics/pen/tqzfG

like image 342
Mechwd Avatar asked Sep 25 '14 17:09

Mechwd


People also ask

How do I stop words breaking?

Keep words on the same line Word automatically breaks the text at a space or a hyphen at the end of a line. To keep two words or a hyphenated word together on one line, you can use a nonbreaking space or nonbreaking hyphen instead of a regular space or hyphen. Click where you want to insert the nonbreaking space.

What is text breaking?

Line breaking, also known as word wrapping, is breaking a section of text into lines so that it will fit into the available width of a page, window or other display area.


2 Answers

Why not use jquery plugin - https://github.com/mytory/jquery-word-break-keep-all

This plugin is for it. IE has CSS property word-break: keep-all; but other browser has not.

like image 164
insanehong Avatar answered Sep 22 '22 11:09

insanehong


The SPACE character generally allows a line break. This is not affected by the word-break property. To disallow a line break, use NO-BREAK SPACE instead of SPACE, e.g. 십 니까. Alternatively, wrap a sequence of characters that should not be broken in a span element and set white-space: nowrap on it.

like image 20
Jukka K. Korpela Avatar answered Sep 22 '22 11:09

Jukka K. Korpela