Class: Decidim::IframeDisabler

Inherits:
Object
  • Object
show all
Defined in:
app/services/decidim/iframe_disabler.rb

Instance Method Summary collapse

Constructor Details

#initialize(text, _options = {}) ⇒ IframeDisabler

Returns a new instance of IframeDisabler.



5
6
7
# File 'app/services/decidim/iframe_disabler.rb', line 5

def initialize(text, _options = {})
  @text = text
end

Instance Method Details

#performObject



9
10
11
12
13
# File 'app/services/decidim/iframe_disabler.rb', line 9

def perform
  @document = Nokogiri::HTML::DocumentFragment.parse(@text)
  disable_iframes(@document)
  document.to_html
end