[imp] Word wrap in spell check (2nd try)

Andrew Morgan morgan at orst.edu
Tue Nov 11 15:24:37 PST 2003


My users have noticed that IMP (latest stable release) does not word wrap
the text before it passes it into the spell checker.  If you have written
a paragraph of text (lets say 4 lines worth) the spell checker will
display it as one really long line, with a left-to-right scroll bar.

I've attached a small patch against the latest stable release of IMP.  It
adds a new variable, $display_msg, which is a word wrapped version of the
message to display to the user at the bottom of the spell checking page.
We have tested it here successfully.

Can this be committed to CVS?

	Andy

-------------- next part --------------
diff -urP imp.orig/spelling.php imp/spelling.php
--- imp.orig/spelling.php	Fri Apr 12 09:57:52 2002
+++ imp/spelling.php	Tue Nov 11 15:13:42 2003
@@ -202,4 +202,9 @@
     }
 }
 
+// Generate a pretty word-wrapped version for displaying
+$display_msg = htmlspecialchars($f_newmsg . $f_message);
+$display_msg = Text::wrap($display_msg, $prefs->getValue('wrap_width'), "\n", Lang::getCharset());
+
+
 ?>
diff -urP imp.orig/templates/compose/spelling.inc imp/templates/compose/spelling.inc
--- imp.orig/templates/compose/spelling.inc	Tue Nov 11 14:50:47 2003
+++ imp/templates/compose/spelling.inc	Tue Nov 11 15:14:20 2003
@@ -130,7 +130,7 @@
   <tr><td colspan="8">&nbsp;</td></tr>
   <tr class="header"><td colspan="8" class="header"><b><?php echo _("Corrected Text") ?></b></td></tr>
   <tr><td colspan="8" class="item">
-    <div class="fixed"><pre><?php echo htmlspecialchars($f_newmsg . $f_message) ?></pre></div>
+    <div class="fixed"><pre><?php echo $display_msg ?></pre></div>
   </td></tr>
 </table>
 


More information about the imp mailing list