From c9e2e9a9d2e77e1d30e2991550eaf61a9357a3f3 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Thu, 12 Nov 2020 21:53:21 +0100 Subject: [PATCH] leaflet: add version 1.7.1 https://leafletjs.com/2020/09/04/leaflet-1.7.1.html --- lib/docs/filters/leaflet/clean_html.rb | 14 +++++++------- lib/docs/scrapers/leaflet.rb | 5 +++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/docs/filters/leaflet/clean_html.rb b/lib/docs/filters/leaflet/clean_html.rb index 802463de..717b7c74 100644 --- a/lib/docs/filters/leaflet/clean_html.rb +++ b/lib/docs/filters/leaflet/clean_html.rb @@ -8,25 +8,25 @@ module Docs node.name = 'h2' end - at_css('> h2:first-child').name = 'h1' - - # remove "This reference reflects Leaflet 1.2.0." - css('h1 ~ p').each do |node| + # remove "This reference reflects Leaflet" + css('p:contains("This reference reflects Leaflet")').each do |node| node.remove break end + at_css('> h2:first-child').name = 'h1' + css('section', 'code b', '.accordion', '.accordion-overflow', '.accordion-content').each do |node| node.before(node.children).remove end css('pre > code').each do |node| node['class'] ||= '' - lang = if node['class'].include?('lang-html') || node.content =~ /\A