lib/render/text/helper/string.rb in render-text-helper-0.3.1 vs lib/render/text/helper/string.rb in render-text-helper-0.3.2
- old
+ new
@@ -16,6 +16,11 @@
return split(separator).map(&:strip) unless separator.nil?
return split(',').map(&:strip) if include?(',')
split.map(&:strip)
end
+
+ # outputs string where it replaces \n or \r with actual return
+ def escaped_newline_to_newline
+ self.gsub('\n', "\n").gsub('\r', "\n")
+ end
end