Index: gotwo.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gotwo/gotwo.module,v
retrieving revision 1.5.2.4
diff -u -r1.5.2.4 gotwo.module
--- gotwo.module	4 Mar 2008 02:04:10 -0000	1.5.2.4
+++ gotwo.module	4 Mar 2008 03:16:01 -0000
@@ -183,6 +183,17 @@
       $args .= $key.'="'.htmlspecialchars($value).'" ';
     }
   }
+  
+  if (variable_get('gotwo_word_wrap',0)) {
+    $len = variable_get('gotwo_word_length',25);
+    $method = variable_get('gotwo_split_method','wordwrap');
+    if ($method == 'truncate') {
+      $text = truncate_utf8($text, $len, FALSE, TRUE);
+    } else {
+      $char = variable_get('gotwo_break_char'," ");
+      $text = wordwrap($text, $len, $char, 1);
+    }
+  }
   return "<a $args>$text</a>";
 }
 
@@ -323,6 +334,34 @@
     '#description' => t('Target labels are the parts after the "go/" part of the shown url. The absolute maximum is 128.'),
     '#default_value' => min(variable_get('gotwo_max_length', 128), 128),
   );
+  
+  $form['gotwo_word_wrap'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Break up url text at specific width'),
+    '#description' => t('Try to ensure long url text is broken up, using the truncate_utf8() function.'),
+    '#default_value' => variable_get('gotwo_word_wrap', 0),
+   );
+
+  $form['gotwo_split_method'] = array(
+    '#type' => 'select',
+    '#title' => t('Select the method for dealing with long url text'),
+    '#description' => t('Use the wordwrap() function to split the text so it will wrap, or truncate the text at a specified length.'),
+    '#default_value' => variable_get('gotwo_split_method','wordwrap'),
+    '#options' => array('wordwrap' => 'wordwrap','truncate' => 'truncate'),
+  );
+
+  $form['gotwo_word_length'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Maximum width of words if word wrapping is enabled above.'),
+    '#description' => t('Numerical width at which to break url text.'),
+    '#default_value' => variable_get('gotwo_word_length', 25),
+   );
+
+  $form['gotwo_break_char'] = array(
+    '#type' => 'select',
+    '#title' => t('Character to use when breaking up long url text.'),
+    '#options' => array(" " => t('space'), "\n" => t('newline')),
+  );
 
   $form['gotwo_disclaimer_boolean'] = array(
     '#type' => 'checkbox',
