I have an HTML page that I generate from the data contained in a database. The database sometimes contains long strings that the browser can\'t break because the strings don\'t
I'm answering my own question here...
Based on your answers, I came up with this solution (thanks to @CMS in this question for his help).
This script breaks any word that is more than 30 characters long by inserting a space at the 31st position.
Here is the fixed version: link
I have one problem left, I'd rather insert a
then a space. But the assigning node.nodeValue
or node.textContent
causes the insertion of the text
not the tag.
I'll wait a few days before I accept this answer in case someone comes up with a simpler solution.
Thanks