Inside a div
, I have Persian text that wraps because I've used
word-wrap: break-word;
and the div's size is smaller than the text.
<div class="r25" style="width: 13.3333px; height: 50px;">
<p style="font-size: 8px;">This is an example of a long text in Persian.</p>
</div>
I'm wondering how I can determine if word-wrap: break-word;
has been implemented?
The phrase
This is an example of a long text in Persian.
appears as follows:
This
is
an
example
of
a
long
text
in
Persian.
These styles such as width
, height
, and font-size
are set by a script. If the word breakup occurs within a word rather than at the end of a word, I want to apply a transformation.
EDIT:
An idea I have is to go through each word, calculate its width, and compare it to the div
's width. However, I'm curious if there might be a simpler solution.