]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/babelfish.pl
ws
[infobot.git] / src / Modules / babelfish.pl
index d1d17ee58456ac718065f3caf6670dd65bb26252..920bf2e10fcc3e2a00dcc4d3e9b2a0dbfff21388 100644 (file)
@@ -115,6 +115,10 @@ sub translate {
         $translated =~ s/<[^>]*>/ /sg;
         # \n to space
         $translated =~ s/[\n\r\t]/ /g;
+        # strip leading whitespace
+        $translated =~ s/^\s+//sg;
+        # strip trailing whitespace
+        $translated =~ s/\s+$//sg;
         # strip multiple whitespace
         $translated =~ s/\s+/ /sg;