mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-16 01:06:32 +01:00
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:
parent
6aae34156e
commit
3af574f76e
5 changed files with 8 additions and 3 deletions
|
|
@ -116,6 +116,10 @@ module ApplicationHelper
|
||||||
def count_undone_todos(todos_parent, string="actions")
|
def count_undone_todos(todos_parent, string="actions")
|
||||||
@controller.count_undone_todos(todos_parent, string)
|
@controller.count_undone_todos(todos_parent, string)
|
||||||
end
|
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))
|
def link_to_context(context, descriptor = sanitize(context.name))
|
||||||
link_to( descriptor, context_path(context), :title => "View context: #{context.name}" )
|
link_to( descriptor, context_path(context), :title => "View context: #{context.name}" )
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<% @contexts.each do |c| -%>
|
<% @contexts.each do |c| -%>
|
||||||
|
|
||||||
<%= c.name.upcase %>
|
<%= 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 -%>
|
<% end -%>
|
||||||
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
<%= p.name.upcase %>
|
<%= p.name.upcase %>
|
||||||
<%= p.description + "\n" if p.description_present? -%>
|
<%= 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? -%>
|
<%= p.linkurl + "\n" if p.linkurl_present? -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
@ -121,7 +121,7 @@ class ContextsControllerTest < TodoContainerControllerTestBase
|
||||||
@request.session['user_id'] = users(:admin_user).id
|
@request.session['user_id'] = users(:admin_user).id
|
||||||
get :index, { :format => "txt" }
|
get :index, { :format => "txt" }
|
||||||
assert_equal 'text/plain; charset=utf-8', @response.headers["Content-Type"]
|
assert_equal 'text/plain; charset=utf-8', @response.headers["Content-Type"]
|
||||||
#puts @response.body
|
assert !(/ /.match(@response.body))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_text_feed_not_accessible_to_anonymous_user_without_token
|
def test_text_feed_not_accessible_to_anonymous_user_without_token
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,7 @@ class ProjectsControllerTest < TodoContainerControllerTestBase
|
||||||
@request.session['user_id'] = users(:admin_user).id
|
@request.session['user_id'] = users(:admin_user).id
|
||||||
get :index, { :format => "txt" }
|
get :index, { :format => "txt" }
|
||||||
assert_equal 'text/plain; charset=utf-8', @response.headers["Content-Type"]
|
assert_equal 'text/plain; charset=utf-8', @response.headers["Content-Type"]
|
||||||
|
assert !(/ /.match(@response.body))
|
||||||
#puts @response.body
|
#puts @response.body
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue