Strip non-breaking space HTML entities from the text feeds. Fixes #443.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@441 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2007-02-17 06:01:54 +00:00
parent 6aae34156e
commit 3af574f76e
5 changed files with 8 additions and 3 deletions

View file

@ -116,6 +116,10 @@ module ApplicationHelper
def count_undone_todos(todos_parent, string="actions")
@controller.count_undone_todos(todos_parent, string)
end
def count_undone_todos_text(todos_parent, string="actions")
count_undone_todos(todos_parent, string).gsub(" "," ")
end
def link_to_context(context, descriptor = sanitize(context.name))
link_to( descriptor, context_path(context), :title => "View context: #{context.name}" )

View file

@ -1,5 +1,5 @@
<% @contexts.each do |c| -%>
<%= c.name.upcase %>
<%= count_undone_todos(c)%>. Context is <%= c.hidden? ? "Hidden" : "Active" %>.
<%= count_undone_todos_text(c)%>. Context is <%= c.hidden? ? "Hidden" : "Active" %>.
<% end -%>

View file

@ -2,6 +2,6 @@
<%= p.name.upcase %>
<%= p.description + "\n" if p.description_present? -%>
<%= count_undone_todos(p)%>. Project is <%= p.state %>.
<%= count_undone_todos_text(p)%>. Project is <%= p.state %>.
<%= p.linkurl + "\n" if p.linkurl_present? -%>
<% end -%>

View file

@ -121,7 +121,7 @@ class ContextsControllerTest < TodoContainerControllerTestBase
@request.session['user_id'] = users(:admin_user).id
get :index, { :format => "txt" }
assert_equal 'text/plain; charset=utf-8', @response.headers["Content-Type"]
#puts @response.body
assert !(/&nbsp;/.match(@response.body))
end
def test_text_feed_not_accessible_to_anonymous_user_without_token

View file

@ -159,6 +159,7 @@ class ProjectsControllerTest < TodoContainerControllerTestBase
@request.session['user_id'] = users(:admin_user).id
get :index, { :format => "txt" }
assert_equal 'text/plain; charset=utf-8', @response.headers["Content-Type"]
assert !(/&nbsp;/.match(@response.body))
#puts @response.body
end