Class: Lcms::Engine::ReactMaterialsResolver

Inherits:
Object
  • Object
show all
Defined in:
app/services/lcms/engine/react_materials_resolver.rb

Class Method Summary collapse

Class Method Details

.resolve(html, document) ⇒ Object



7
8
9
10
11
12
13
# File 'app/services/lcms/engine/react_materials_resolver.rb', line 7

def resolve(html, document)
  content = Nokogiri::HTML.fragment(html)
  content.css("[data-react-class='MaterialsContainer']").each do |node|
    replace_react(node, document)
  end
  content.to_html
end