Skip to content

Commit

Permalink
optimize for jekyll
Browse files Browse the repository at this point in the history
  • Loading branch information
zhgchgli0718 committed Jun 11, 2022
1 parent 4d7faae commit c075d70
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ZMediumToMarkdown.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
gem.files = Dir['lib/**/*.*']
gem.executables = ['ZMediumToMarkdown']
gem.name = 'ZMediumToMarkdown'
gem.version = '1.7.2'
gem.version = '1.7.3'

gem.license = "MIT"

Expand Down
2 changes: 1 addition & 1 deletion ZMediumToMarkdown_Github.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
gem.files = Dir['lib/**/*.*']
gem.executables = ['ZMediumToMarkdown']
gem.name = 'zmediumtomarkdown'
gem.version = '1.7.2'
gem.version = '1.7.3'

gem.license = "MIT"

Expand Down
7 changes: 5 additions & 2 deletions lib/Parsers/IframeParser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@ def parse(paragraph)
gist.gsub! '\"', '"'
gist.gsub! '<\/', '</'
gistHTML = Nokogiri::HTML(gist)
lang = gistHTML.search('table').first['data-tagsearch-lang']
lang = gistHTML.search('table').first['data-tagsearch-lang'].downcase
if isForJekyll and lang == "objective-c"
lang = "objectivec"
end
gistHTML.search('a').each do |a|
if a.text == 'view raw'
gistRAW = Request.body(Request.URL(a['href']))
result = "```#{lang.downcase}\n#{gistRAW}\n```"
result = "```#{lang}\n#{gistRAW}\n```"
end
end
end
Expand Down

0 comments on commit c075d70

Please sign in to comment.