Commit 2945d42e76f5aef0294fda6ca047beb2d0ecaa8e:
    handle long lines with no spaces


Branch: refs/heads/master
Author: Sam Ruby <[email protected]>
Committer: Sam Ruby <[email protected]>
Pusher: rubys <[email protected]>

------------------------------------------------------------
www/board/agenda/views/pages/report.js.rb                    | ++++ --
------------------------------------------------------------
6 changes: 4 additions, 2 deletions.
------------------------------------------------------------


diff --git a/www/board/agenda/views/pages/report.js.rb 
b/www/board/agenda/views/pages/report.js.rb
index 32c68bf..2ad96d4 100644
--- a/www/board/agenda/views/pages/report.js.rb
+++ b/www/board/agenda/views/pages/report.js.rb
@@ -94,8 +94,10 @@ def linebreak(text)
     indicies = [];
     while result = regex.exec(text)
       line = result[0]
-      lastspace = /^.*\s\S/.exec(line)[0].length - 1
-      indicies.unshift([line, result.index]) if lastspace > 40
+      lastspace = /^.*\s\S/.exec(line)
+      if lastspace and lastspace[0].lentgh -1 > 40
+        indicies.unshift([line, result.index]) 
+      end
     end
 
     # reflow each line found

Reply via email to