diff --git a/app/helpers/blog_helper.rb b/app/helpers/blog_helper.rb index 09d8e42..9d76b82 100644 --- a/app/helpers/blog_helper.rb +++ b/app/helpers/blog_helper.rb @@ -42,7 +42,7 @@ module BlogHelper def display_post(article, format = 'full') no_comments = (format == 'full') ? false : true - html = send("display_#{format}_format", article) + html = send("display_#{format}_format", article).html_safe article_title(article, :no_comments => no_comments) + html end diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb index 2bb1eaf..f103e79 100644 --- a/test/functional/content_viewer_controller_test.rb +++ b/test/functional/content_viewer_controller_test.rb @@ -1256,4 +1256,19 @@ class ContentViewerControllerTest < ActionController::TestCase assert_tag :tag => 'a', :attributes => { :href => "/#{profile.identifier}/#{article.path}?comment_page=2", :rel => 'next' } end + should 'not escape acceptable HTML in list of blog posts' do + login_as('testinguser') + blog = Blog.create!(:name => 'A blog test', :profile => profile) + blog.posts << TinyMceArticle.create!( + :name => 'Post', + :profile => profile, + :parent => blog, + :published => true, + :body => "
This is a bold statement right there!
" + ) + + get :view_page, :profile => profile.identifier, :page => [blog.path] + assert_tag :tag => 'strong', :content => /bold/ + end + end -- libgit2 0.21.2