whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/1] Commit 2945d42: handle long lines with no spaces
Date Wed, 17 Feb 2016 15:23:24 GMT
Commit 2945d42e76f5aef0294fda6ca047beb2d0ecaa8e:
    handle long lines with no spaces


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@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

Mime
View raw message