Task description: LInks are broken after 100 characters
Brought to you by:
andrewsimpson
The RE that is used to break extra long words breaks links as well.
Here is a quick fix:
diff -r 916aa148575b -r 2f29d5c611bc webcollab/includes/common.php
--- a/webcollab/includes/common.php Fr Jun 22 20:09:28 2012 +1200
+++ b/webcollab/includes/common.php Fr Jul 20 13:03:49 2012 +0200
@@ -75,7 +75,7 @@
$body = str_replace("\r\n", "\n", $body );
$body = str_replace("\r", "\n", $body );
//break up long non-wrap words
- $body = preg_replace("/[^\s\n\t]{100}/u", "$0\n", $body );
+ $body = preg_replace("/[^\s\n\t\/.,:;=]{100}/u", "$0\n", $body );
//add HTML entities
$body = html_clean_up($body);
Thanks. Do the long links then cause the 'boxes' to be become longer and distorted?
I'll do a quick test, and then add to the Git repo.
The link address (for which the regexp was designed) does not render visually so there is no layout affected. However, it may well cause other text containing punctuation (that's what we are looking at) to not break, but I believe that text areas allow word breaks on punctuation even if there is no space included. Having said that, this change has only had the most cursory testing yet so no guarantees :-)
Spent a while on this, but in the end I wasn't happy with it, so I reversed the git commit.
Thanks for the patch.