mirror of
https://github.com/projekteuler/projekteuler.git
synced 2026-01-26 18:18:51 +01:00
Allow translation content styling through scrubber
This commit is contained in:
13
app/scrubbers/translation_content_scrubber.rb
Normal file
13
app/scrubbers/translation_content_scrubber.rb
Normal file
@@ -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
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<%= panel do %>
|
||||
<div class="panel-body problem-content">
|
||||
<%= sanitize @translation.content %>
|
||||
<%= sanitize @translation.content, scrubber: TranslationContentScrubber.new %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="text-center">
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<% end %>
|
||||
<%= panel do %>
|
||||
<div class="panel-body problem-content">
|
||||
<%= sanitize @problem.content %>
|
||||
<%= sanitize @problem.content, scrubber: TranslationContentScrubber.new %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="text-center">
|
||||
|
||||
Reference in New Issue
Block a user