Method: IsoDoc::WordFunction::Postprocess#list_add
- Defined in:
- lib/isodoc/word_function/postprocess.rb
#list_add(xpath, lvl) ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/isodoc/word_function/postprocess.rb', line 92 def list_add(xpath, lvl) xpath.each do |list| (list.xpath(".//li") - list.xpath(".//ol//li | .//ul//li")).each do |l| l.xpath("./p | ./div").each_with_index do |p, i| next if i == 0 p.wrap(%{<div class="ListContLevel#{lvl}"/>}) end list_add(l.xpath(".//ul") - l.xpath(".//ul//ul | .//ol//ul"), lvl + 1) list_add(l.xpath(".//ol") - l.xpath(".//ul//ol | .//ol//ol"), lvl + 1) end end end |