class Playbook::PbIcon::Icon
def render_svg(path)
def render_svg(path) if File.extname(path) == ".svg" doc = Nokogiri::XML(URI.open(path)) # rubocop:disable Security/Open svg = doc.at_css "svg" svg["class"] = "pb_custom_icon " + object.custom_icon_classname raw doc else raise("Custom icon must be an svg. Please check your path and file type.") end end