#96 Task description: LInks are broken after 100 characters

None
closed-wont-fix
None
5
2013-03-05
2012-07-20
Klaus Rennecke
No

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);

Discussion

  • Andrew Simpson
    Andrew Simpson
    2012-07-20

    • assigned_to: nobody --> andrewsimpson
     
  • Andrew Simpson
    Andrew Simpson
    2012-07-20

    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.

     
  • Klaus Rennecke
    Klaus Rennecke
    2012-07-23

    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 :-)

     
  • Andrew Simpson
    Andrew Simpson
    2013-03-05

    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.

     
  • Andrew Simpson
    Andrew Simpson
    2013-03-05

    • status: open --> closed-wont-fix
    • milestone: -->