Class: Coradoc::Docx::Transform::Rules::ProofErrorRule

Inherits:
Coradoc::Docx::Transform::Rule show all
Defined in:
lib/coradoc/docx/transform/rules/proof_error_rule.rb

Overview

Silently ignores w:proofErr (proofing error) elements.

Proofing errors are spelling/grammar markers in OOXML that have no semantic representation in CoreModel. This rule matches them and returns nil, effectively stripping them from the output.

Instance Method Summary collapse

Methods inherited from Coradoc::Docx::Transform::Rule

#priority

Instance Method Details

#apply(_element, _context) ⇒ Object



18
19
20
# File 'lib/coradoc/docx/transform/rules/proof_error_rule.rb', line 18

def apply(_element, _context)
  nil
end

#matches?(element) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
# File 'lib/coradoc/docx/transform/rules/proof_error_rule.rb', line 13

def matches?(element)
  defined?(Uniword::Wordprocessingml::ProofError) &&
    element.is_a?(Uniword::Wordprocessingml::ProofError)
end