Method: IsoDoc::HtmlFunction::Comments#insert_comment_cont

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

#insert_comment_cont(from, to, target) ⇒ Object



101
102
103
104
105
106
107
108
109
110
111
# File 'lib/isodoc/html_function/comments.rb', line 101

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