Inserting HTML tag in the middle of Arabic word breaks word connection (cursive)

I’m not sure if there’s any HTML way to do it, but you can fix it by adding a zero-width joiner Unicode character before the opening span tag:

<p>كت&#x200d;<span style="color: Red;">ب</span></p>

You can use the actual Unicode character instead of the HTML character entity, of course, but that wouldn’t be visible here. Or you can use the prettier &zwj; entity.

Here it is in action (using an invisible <b> tag, since I can’t do color here), without the joiner:

كتب

and with the joiner:

كت‍ب

It’s supposed to work without the joiner as far as I understand it, though, and it does in some browsers, but clearly not all of them.

Leave a Comment