mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-27 09:46:22 +00:00
Merge branch 'limpieza-del-editor' into panel.sutty.nl
This commit is contained in:
commit
c2db05b6b2
1 changed files with 11 additions and 0 deletions
|
@ -72,6 +72,17 @@ class MetadataContent < MetadataTemplate
|
||||||
resource['controls'] = true
|
resource['controls'] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Elimina los estilos salvo los que asigne el editor
|
||||||
|
html.css('*').each do |element|
|
||||||
|
next if elements_with_style.include? element.name.downcase
|
||||||
|
|
||||||
|
element.remove_attribute('style')
|
||||||
|
end
|
||||||
|
|
||||||
html.to_s.html_safe
|
html.to_s.html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def elements_with_style
|
||||||
|
@elements_with_style ||= %w[div mark].freeze
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue