Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhgchgli0718 committed Jun 12, 2022
1 parent 0871fde commit 8dbb464
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 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.4'
gem.version = '1.7.5'

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.4'
gem.version = '1.7.5'

gem.license = "MIT"

Expand Down
10 changes: 3 additions & 7 deletions lib/Parsers/IMGParser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,16 @@ def parse(paragraph)
absolutePath = imagePathPolicy.getAbsolutePath(fileName)

result = ""
comment = ""
if paragraph.orgText != ""
comment = " \"#{paragraph.orgText}\""
end

if ImageDownloader.download(absolutePath, imageURL)
relativePath = "#{pathPolicy.getRelativePath(nil)}/#{imagePathPolicy.getRelativePath(fileName)}"
if isForJekyll
result = "\r\n![#{paragraph.text}](/#{relativePath}#{comment})\r\n"
result = "\r\n![#{paragraph.orgText}](/#{relativePath} \"#{paragraph.orgText}\")\r\n"
else
result = "\r\n![#{paragraph.text}](#{relativePath}#{comment})\r\n"
result = "\r\n![#{paragraph.orgText}](#{relativePath} \"#{paragraph.orgText}\")\r\n"
end
else
result = "\r\n![#{paragraph.text}](#{imageURL}#{comment})\r\n"
result = "\r\n![#{paragraph.orgText}](#{imageURL} \"#{paragraph.orgText}\")\r\n"
end

if paragraph.text != ""
Expand Down

0 comments on commit 8dbb464

Please sign in to comment.