Method: IsoDoc::WordFunction::Comments#get_comments_from_text

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

#get_comments_from_text(docxml, link_order) ⇒ Object



125
126
127
128
129
130
131
132
133
134
# File 'lib/isodoc/word_function/comments.rb', line 125

def get_comments_from_text(docxml, link_order)
  comments = []
  docxml.xpath("//div[@style='mso-element:comment']").each do |c|
    next unless c["id"] && !link_order[c["id"]].nil?

    comments << { text: c.remove.to_s, id: c["id"] }
  end
  comments.sort! { |a, b| link_order[a[:id]] <=> link_order[b[:id]] }
  # comments
end