summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2013-10-17 10:38:01 +0200
committerAlex Legler <alex@a3li.li>2013-10-17 10:38:01 +0200
commit3b6ecbdb319ce348c0adc2baed29dec6fd2ae81f (patch)
tree02b3ce7c36935a0b1a66d3a07854b3eef0600aeb /app
parentcomments_controller: Permit parameters (diff)
downloadglsamaker-3b6ecbdb319ce348c0adc2baed29dec6fd2ae81f.tar.gz
glsamaker-3b6ecbdb319ce348c0adc2baed29dec6fd2ae81f.tar.bz2
glsamaker-3b6ecbdb319ce348c0adc2baed29dec6fd2ae81f.zip
glsa_helper: Fix word_wrap invocation for rails 4
Diffstat (limited to 'app')
-rw-r--r--app/helpers/glsa_helper.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/helpers/glsa_helper.rb b/app/helpers/glsa_helper.rb
index 176a4b6..7270461 100644
--- a/app/helpers/glsa_helper.rb
+++ b/app/helpers/glsa_helper.rb
@@ -123,12 +123,12 @@ module GlsaHelper
text.gsub!(/<\/?(b|i)>/, '')
text.gsub!(/^\*\s+(.*)$/) do |s|
- '* ' + word_wrap($1, 69).gsub("\n","\n ")
+ '* ' + word_wrap($1, :line_width => 69).gsub("\n","\n ")
end
text.gsub!(/(?:<ul>\s*(.*?)<\/ul>(?:\s*\n)?)/m) do |s|
$1.gsub(/<li>(.*?)<\/li>\s*/) do |t|
- ('* ' + word_wrap($1, 69)).gsub("\n", "\n ") + "\n\n"
+ ('* ' + word_wrap($1, :line_width => 69)).gsub("\n", "\n ") + "\n\n"
end
end
@@ -137,15 +137,15 @@ module GlsaHelper
text.gsub!(/(?:<ol>\s*(.*?)<\/ol>(?:\s*\n)?)/m) do |s|
nom = 0
$1.gsub(/<li>(.*?)<\/li>\s*/) do |t|
- ("#{nom += 1}. " + word_wrap($1, 68)).gsub("\n", "\n ") + "\n\n"
+ ("#{nom += 1}. " + word_wrap($1, :line_with => 68)).gsub("\n", "\n ") + "\n\n"
end
end
text.gsub!(/(?:<code>\s*(.*?)<\/code>(?:\s*\n)?)/m) do |s|
- (' ' + word_wrap(shorten_args ? shorten_args($1) : $1, 69)).gsub("\n", "\n ") + "\n\n"
+ (' ' + word_wrap(shorten_args ? shorten_args($1) : $1, :line_width => 69)).gsub("\n", "\n ") + "\n\n"
end
- word_wrap(text.chomp, 71)
+ word_wrap(text.chomp, :line_width => 71)
end
def template_popups