[devdocsgjs/main: 106/239] Fix rails clean_html_guides filter
- From: Andy Holmes <andyholmes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devdocsgjs/main: 106/239] Fix rails clean_html_guides filter
- Date: Fri, 8 Apr 2022 07:47:36 +0000 (UTC)
commit 7e571ee48cf32173e611f6bc6fb2e10991c7b2dc
Author: Enoc <brianhernandez222 hotmail com>
Date: Sat Jan 8 17:38:21 2022 -0600
Fix rails clean_html_guides filter
lib/docs/filters/rails/clean_html_guides.rb | 4 +++-
lib/docs/scrapers/rdoc/rails.rb | 1 -
2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/lib/docs/filters/rails/clean_html_guides.rb b/lib/docs/filters/rails/clean_html_guides.rb
index a40dcba0..0c39d137 100644
--- a/lib/docs/filters/rails/clean_html_guides.rb
+++ b/lib/docs/filters/rails/clean_html_guides.rb
@@ -24,7 +24,9 @@ module Docs
css('pre').each do |node|
code = node.at_css('code')
- language = code['class'][/highlight ?(\w+)/, 1]
+ language = code['class']
+ break if language.nil?
+ language = language [/highlight ?(\w+)/, 1]
node['data-language'] = language unless language == 'plain'
code.remove_attribute('class')
node.content = node.content.strip
diff --git a/lib/docs/scrapers/rdoc/rails.rb b/lib/docs/scrapers/rdoc/rails.rb
index a4bde522..3f2e1f27 100644
--- a/lib/docs/scrapers/rdoc/rails.rb
+++ b/lib/docs/scrapers/rdoc/rails.rb
@@ -109,7 +109,6 @@ module Docs
def get_latest_version(opts)
doc = fetch_doc('https://rubyonrails.org/', opts)
- doc
doc.at_css('.heading__button span').content.scan(/\d\.\d*\.*\d*\.*\d*/)[0]
end
end
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]