Class: ODFWriter::Text
Overview
Text: replace text items
Constant Summary collapse
- DELIMITERS =
constants
%w({ })
Instance Attribute Summary
Attributes inherited from Field
Instance Method Summary collapse
-
#replace!(content, item = nil) ⇒ Object
replace!.
Methods inherited from Field
Constructor Details
This class inherits a constructor from ODFWriter::Field
Instance Method Details
#replace!(content, item = nil) ⇒ Object
replace!
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/odf_writer/text.rb', line 43 def replace!(content, item = nil) return unless node = find_text_node(content) text = value(item) @parser = Parser::Default.new(text, node, :doc => content, :remove_classes => @remove_classes, :remove_class_prefix => @remove_class_prefix, :remove_class_suffix => @remove_class_suffix ) @parser.paragraphs.each do |p| node.before(p) end node.remove end |