Method: IsoDoc::HtmlFunction::Comments#insert_comment_cont

Defined in:
lib/isodoc/html_function/comments.rb

#insert_comment_cont(from, upto, target) ⇒ Object



97
98
99
100
101
102
103
104
105
106
107
# File 'lib/isodoc/html_function/comments.rb', line 97

def insert_comment_cont(from, upto, target)
  # includes_to = from.at(".//*[@id='#{upto}']")
  while !from.nil? && from["id"] != upto
    following = from.xpath("./following::*")
    (from = following.shift) && incl_to = from.at(".//*[@id='#{upto}']")
    while !incl_to.nil? && !from.nil? && skip_comment_wrap(from)
      (from = following.shift) && incl_to = from.at(".//*[@id='#{upto}']")
    end
    wrap_comment_cont(from, target) if !from.nil?
  end
end