Class: SvgConform::Remediations::NoExternalCssRemediation
- Inherits:
-
BaseRemediation
- Object
- Lutaml::Model::Serializable
- BaseRemediation
- SvgConform::Remediations::NoExternalCssRemediation
- Defined in:
- lib/svg_conform/remediations/no_external_css_remediation.rb
Overview
Remediation action to remove external CSS references
Instance Method Summary collapse
Methods inherited from BaseRemediation
#execute, #should_execute?, #to_s
Instance Method Details
#apply(document, context) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/svg_conform/remediations/no_external_css_remediation.rb', line 14 def apply(document, context) changes = [] case @strategy when "remove_external_references" changes += remove_external_link_elements(document, context) changes += remove_external_imports_from_style_elements(document, context) changes += remove_external_urls_from_style_attributes(document, context) else context.add_error( message: "Unknown remediation strategy: #{@strategy}", node: document.root, ) return [] end if @log_removed_elements && changes.any? log_remediation(context, "Removed #{changes.length} external CSS references") end changes end |