159
160
161
162
163
164
165
166
167
168
169
170
171
|
# File 'lib/isodoc/word_function/postprocess.rb', line 159
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 | ./table").each_with_index do |p, i|
next if i.zero?
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
|