diff --git a/app/scrubbers/translation_content_scrubber.rb b/app/scrubbers/translation_content_scrubber.rb new file mode 100644 index 0000000..2c17b50 --- /dev/null +++ b/app/scrubbers/translation_content_scrubber.rb @@ -0,0 +1,13 @@ +class TranslationContentScrubber < Rails::Html::PermitScrubber + def initialize + super + self.tags = %w( strong em b i p code pre tt samp kbd var sub + sup dfn cite big small address hr br div span h1 h2 h3 h4 h5 h6 ul ol li dl dt dd abbr + acronym a img blockquote del ins ) + self.attributes = %w( href src width height alt cite datetime title class name xml:lang abbr style ) + end + + def skip_node?(node) + node.text? + end +end diff --git a/app/views/admin/translations/show.html.erb b/app/views/admin/translations/show.html.erb index 0c96aac..efe40c1 100644 --- a/app/views/admin/translations/show.html.erb +++ b/app/views/admin/translations/show.html.erb @@ -23,7 +23,7 @@ <%= panel do %>
This is centered.
' + status: 1 \ No newline at end of file diff --git a/test/models/problem_test.rb b/test/models/problem_test.rb index eff3db1..2f042a8 100644 --- a/test/models/problem_test.rb +++ b/test/models/problem_test.rb @@ -26,7 +26,7 @@ class ProblemTest < ActiveSupport::TestCase end test "should return correct number of translated problems" do - assert_equal 2, Problem.translated_count + assert_equal 3, Problem.translated_count end test "should allow for problem count updating" do @@ -44,7 +44,7 @@ class ProblemTest < ActiveSupport::TestCase assert_raises ArgumentError do Problem.update_count(1) end - assert_equal 3, Problem.count() + assert_equal 4, Problem.count() assert_equal "First title", Problem.find(1).title end end