Within my Angular 5 application, I am faced with a requirement to display HTML content retrieved from a database. An example of the text stored in the database is:
<div><u>Documents and Files</u></div><ul><li>These documents need to be tested and reviewed. Please check the details.</li></ul>
In the application, this content is displayed as shown in the image below:
https://i.sstatic.net/Rwti5.jpg
To achieve this rendering, the following code snippet is implemented:
<div [innerHTML]="description"></div>
The current implementation successfully displays the content, however, it faces a challenge where words are being wrapped in the middle. For instance, in the provided sample, 't' and 'he' are split across two lines.
I aim to modify the behavior so that text is wrapped at spaces between whole words instead of breaking a word in half. This would ensure that words like 'the' appear on the next line if needed.
What steps can be taken to accomplish this desired word-wrapping functionality within the Angular application?