135
136
137
138
139
140
141
142
143
144
145
146
147
|
# File 'lib/isodoc/word_function/postprocess.rb', line 135
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|
i.zero? or 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
|