Avoid incorrect packaging of some words in RTL languages ​​(Farsi, Arabic)

In Farsi, Arabic, and some other RTL languages, letters are related to each other (for example, سیب), but not always (for example, می شود). The problem is that sometimes a space causes half a word to wrap to the next line.

Example of incorrect packaging

This is completely wrong, but I don't want to turn off all the wrapping style of this paragraph. Microsoft Word solved this issue by clicking ctrl+shift+space

. This results in a different white space between letters that are not wrapped. How can I achieve something similar in HTML and CSS?

Here's a jsFiddle example: https://jsfiddle.net/gb0p72b2/ .


source to share

2 answers

You are looking for the non-breaking space character . In MS Word, ctrl+shift+space

inserts a non-breaking space character. To do this in HTML, use a  

space instead of a regular space. Check out JSFiddler: https://jsfiddle.net/6k0p9h5k/



Not sure if without a real Arabic page to test, but CSS word-wrap: normal

in the elements li

might help.



All Articles