You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2017/06/20 17:04:14 UTC
[whimsy] 01/02: more long line tweaks
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
commit cc35970f05c691d4fc6aec7a2c6102ee62f7a820
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Tue Jun 20 12:56:12 2017 -0400
more long line tweaks
---
www/board/agenda/views/pages/report.js.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/www/board/agenda/views/pages/report.js.rb b/www/board/agenda/views/pages/report.js.rb
index 23763dd..8b4f105 100644
--- a/www/board/agenda/views/pages/report.js.rb
+++ b/www/board/agenda/views/pages/report.js.rb
@@ -96,10 +96,10 @@ class Report < React
return text.gsub 'TODO', '<span class="missing">TODO</span>'
end
- # Break long lines
+ # Break long lines, treating HTML Entities (like &) as one character
def linebreak(text)
# find long, breakable lines
- regex = Regexp.new(/.{80}.+/, 'g')
+ regex = Regexp.new(/(\&\w+;|.){80}.+/, 'g')
result = nil
indicies = [];
while result = regex.exec(text)
@@ -107,7 +107,7 @@ class Report < React
break if line.gsub(/\&\w+;/, '.').length < 80
lastspace = /^.*\s\S/.exec(line)
- if lastspace and lastspace[0].length - 1 > 40
+ if lastspace and lastspace[0].gsub(/\&\w+;/, '.').length - 1 > 40
indicies.unshift([line, result.index])
end
end
--
To stop receiving notification emails like this one, please contact
"commits@whimsical.apache.org" <co...@whimsical.apache.org>.