You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sam Ruby <ru...@apache.org> on 2016/02/17 16:23:24 UTC

[whimsy.git] [1/1] Commit 2945d42: handle long lines with no spaces

Commit 2945d42e76f5aef0294fda6ca047beb2d0ecaa8e:
    handle long lines with no spaces


Branch: refs/heads/master
Author: Sam Ruby <ru...@intertwingly.net>
Committer: Sam Ruby <ru...@intertwingly.net>
Pusher: rubys <ru...@apache.org>

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