From de4c884f2fb512c3bf9ca87222b3602c96232788 Mon Sep 17 00:00:00 2001 From: Mateus Pereira Date: Tue, 10 Oct 2023 10:07:53 -0300 Subject: [PATCH] Remove parent divs only once for each `ul` element --- lib/docs/filters/cppref/clean_html.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/docs/filters/cppref/clean_html.rb b/lib/docs/filters/cppref/clean_html.rb index d7f564ff..79311bb1 100644 --- a/lib/docs/filters/cppref/clean_html.rb +++ b/lib/docs/filters/cppref/clean_html.rb @@ -19,8 +19,9 @@ module Docs node.before(node.children).remove end - css('div > ul').each do |node| - node.parent.before(node.parent.children).remove + parents = css('div > ul').map(&:parent).uniq + parents.each do |parent| + parent.before(parent.children).remove end css('dl > dd:first-child:last-child > ul:first-child:last-child').each do |node|