From 364de9dbabd58aed36a1be3afe2c2984251702fd Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Sat, 3 Sep 2011 11:33:51 -0500 Subject: [PATCH] Better 3rd time's the charm? --- app/helpers/application_helper.rb | 2 +- app/views/layouts/default.rhtml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1571913b..a7ced3c5 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -96,7 +96,7 @@ require 'instiki_stringsupport' # Performs HTML escaping on text, but keeps linefeeds intact (by replacing them with
) def escape_preserving_linefeeds(text) - h(text).gsub(/\n/, '
').as_utf8 + h(text).gsub(/\n/, '
').as_utf8.html_safe end def format_date(date, include_time = true) diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 1c84ed1d..c05e0292 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -78,11 +78,11 @@ <%= render(:file => 'navigation') unless @web.nil? || @hide_navigation %> <%- if flash[:info] -%> -
<%= escape_preserving_linefeeds flash[:info].html_safe %>
+
<%= escape_preserving_linefeeds flash[:info] %>
<%- end -%> <%- if @error or flash[:error] -%> -
<%= escape_preserving_linefeeds(@error || flash[:error].html_safe) %>
+
<%= escape_preserving_linefeeds(@error || flash[:error]) %>
<%- end -%> <%= @content_for_layout %>