From 8cb9de7faa60858a822ca53f28fce31de59d6b7b Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sun, 23 Oct 2022 09:52:16 +0200 Subject: [PATCH] Update Vue.js documentation (3.2.41) --- lib/docs/filters/vue/clean_html.rb | 29 ++++++++--------------------- lib/docs/scrapers/vue.rb | 2 +- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/lib/docs/filters/vue/clean_html.rb b/lib/docs/filters/vue/clean_html.rb index 288e7bf3..b2784d3e 100644 --- a/lib/docs/filters/vue/clean_html.rb +++ b/lib/docs/filters/vue/clean_html.rb @@ -21,32 +21,19 @@ module Docs node.name = 'strong' end - # Remove CodePen div - css('.codepen').each do |node| - next if node.previous_element.nil? - span = node.css('span:contains("See the Pen")').remove - node.previous_element.add_child(' ') - node.previous_element.add_child(span) - node.remove - end - # Remove code highlighting - css('figure').each do |node| - node.name = 'pre' - node.content = node.at_css('td.code pre').css('.line').map(&:content).join("\n") - node['data-language'] = node['class'][/highlight (\w+)/, 1] - end - css('.line-numbers-wrapper').remove css('pre').each do |node| - node.content = node.content.strip - node['data-language'] = 'javascript' + node.parent.name = 'pre' + node.parent['data-language'] = node.parent['class'][/language-(\w+)/, 1] + node.parent['data-language'] = 'javascript' if node.parent['data-language'][/vue/] # unsupported by prism.js + node.parent.remove_attribute 'class' + node.parent.content = node.content.strip end - css('iframe').each do |node| - node['sandbox'] = 'allow-forms allow-scripts allow-same-origin' - node.remove if node['src'][/player.vimeo.com/] # https://v3.vuejs.org/guide/migration/introduction.html#overview - end + css('.vue-mastery-link').remove + css('.vuejobs-wrapper').remove + css('.vueschool').remove css('details').each do |node| node.name = 'div' diff --git a/lib/docs/scrapers/vue.rb b/lib/docs/scrapers/vue.rb index dd0a94a5..e06da2a1 100644 --- a/lib/docs/scrapers/vue.rb +++ b/lib/docs/scrapers/vue.rb @@ -19,7 +19,7 @@ module Docs HTML version '3' do - self.release = '3.2.31' + self.release = '3.2.41' self.base_url = 'https://vuejs.org/' self.initial_paths = %w(guide/introduction.html) html_filters.push 'vue/entries_v3', 'vue/clean_html'