Class: Uniword::Wordprocessingml::InstrText

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/uniword/wordprocessingml/instr_text.rb

Overview

Field instruction text

Generated from OOXML schema: wordprocessingml.yml Element: <w:instrText>

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ InstrText

Returns a new instance of InstrText.



24
25
26
27
28
29
30
# File 'lib/uniword/wordprocessingml/instr_text.rb', line 24

def initialize(attrs = {})
  if attrs[:text].is_a?(String) && (attrs[:text].start_with?(" ") || attrs[:text].end_with?(" ") || attrs[:text].include?("\t"))
    attrs[:xml_space] =
      "preserve"
  end
  super
end