Skip to content

Commit

Permalink
Escape new lines
Browse files Browse the repository at this point in the history
Some browsers screw up the text area view when new lines are not escaped
properly.
  • Loading branch information
indrekj committed Mar 4, 2012
1 parent d874c91 commit 2bf0313
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/best_in_place/helper.rb
Expand Up @@ -85,7 +85,12 @@ def build_value_for(object, field, opts)
end

def attribute_escape(data)
data.to_s.gsub("&", "&").gsub("'", "'") unless data.nil?
return unless data

data.to_s.
gsub("&", "&").
gsub("'", "'").
gsub("\n", "
")
end
end
end
Expand Down

0 comments on commit 2bf0313

Please sign in to comment.