You can try a mixed solution in which you use CSS and JS to mimic words and then move them to a new line if they arenβt enough.
The test I used uses a CSS class with a built-in display unit, and then completes each Korean word in between. CSS
.korean-word { display: inline-block; }
Use the JS / jQuery code as follows:
var p = $(".hero__description"); var text = p.text(); var nospace = /(\S+)/g; var p1 = text.replace(nospace, "<span class='korean-word'>$1</span>"); p.html(p1);
The code simply takes the text, looks at things that are NOT spaces, and then puts these things in the elements of the HTML range. Thus, you force the word to jump to a new line.
source share