ZMediumToMarkdown 2.4.1 → 2.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/Parsers/IframeParser.rb +19 -11
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8a5ca887a7781219ae534d50ebe022c796d21ddc6eb5fab977559fd65ce4cb2
4
- data.tar.gz: 4e43067b4502adc9a11cf3347c68091980c273e567d22811e6d4d02b233ef5a8
3
+ metadata.gz: b853d78f150d3134ac412b310a53a864fa4808a7c6dd476c28f534ecc607de18
4
+ data.tar.gz: 886dcd5efb04f28a033eb6ca80ed2babaa2f37c9afc4d524a776b3f154d96f35
5
5
  SHA512:
6
- metadata.gz: 8e7ecbc20c8038097d213bfce93f6129b8451f7a990ad97c04f07533b6b9c0be8c0a913d4599d19b8aa6ca8e8d95724da4190f6f55c5678c5e944078d022a390
7
- data.tar.gz: 7ea56ec01d108d51a1f56087e28a5596a7e865dbc937507ccf2e029ed8ac1f536225a940437d30a5e36ab3a74e7c1fef38b410f0adc7b6081144baafdcbd3e4b
6
+ metadata.gz: 7492890c6dbacf64ea895246224692d73925359489fd97383c6331eb613201dc64963631a72eaa2ae708470ebf912199057f800428ca847284300da1bb091b46
7
+ data.tar.gz: 869962271b377b7e258bf013d7136befba33bb8a72272f5aee15e10af209e1be276028c344bfb2335d094f28bffaabff723c6fd8f600a6a5051e7baa0b5a9bf0
@@ -76,20 +76,28 @@ class IframeParser < Parser
76
76
  gist.gsub! '\"', '"'
77
77
  gist.gsub! '<\/', '</'
78
78
  gistHTML = Nokogiri::HTML(gist)
79
- lang = gistHTML.search('table').first['data-tagsearch-lang'].downcase
80
- if isForJekyll and lang == "objective-c"
81
- lang = "objectivec"
82
- end
83
- gistHTML.search('a').each do |a|
84
- if a.text == 'view raw'
85
- gistRAW = Request.body(Request.URL(a['href']))
79
+
80
+ lang = gistHTML.search('table').first['data-tagsearch-lang']
86
81
 
87
- result = "```#{lang}\n"
82
+ if !lang.nil?
83
+ lang = lang.downcase
84
+ if isForJekyll and lang == "objective-c"
85
+ lang = "objectivec"
86
+ end
87
+ gistHTML.search('a').each do |a|
88
+ if a.text == 'view raw'
89
+ gistRAW = Request.body(Request.URL(a['href']))
88
90
 
89
- result += gistRAW.chomp
90
-
91
- result += "\n```"
91
+ result = "```#{lang}\n"
92
+
93
+ result += gistRAW.chomp
94
+
95
+ result += "\n```"
96
+ end
92
97
  end
98
+ else
99
+ clean_url = srce.to_s.gsub(/\.js$/, '')
100
+ result = "[#{clean_url}](#{clean_url})#{jekyllOpen}"
93
101
  end
94
102
  else
95
103
  ogURL = url
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ZMediumToMarkdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhgChgLi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-11 00:00:00.000000000 Z
11
+ date: 2024-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri