From 8dbb464ad2002c657ac7e6899587788facd134ef Mon Sep 17 00:00:00 2001 From: zhgchgli Date: Mon, 13 Jun 2022 00:06:34 +0800 Subject: [PATCH] fix bug --- ZMediumToMarkdown.gemspec | 2 +- ZMediumToMarkdown_Github.gemspec | 2 +- lib/Parsers/IMGParser.rb | 10 +++------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ZMediumToMarkdown.gemspec b/ZMediumToMarkdown.gemspec index 937a989..2491f38 100644 --- a/ZMediumToMarkdown.gemspec +++ b/ZMediumToMarkdown.gemspec @@ -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" diff --git a/ZMediumToMarkdown_Github.gemspec b/ZMediumToMarkdown_Github.gemspec index 99f182d..44c5561 100644 --- a/ZMediumToMarkdown_Github.gemspec +++ b/ZMediumToMarkdown_Github.gemspec @@ -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" diff --git a/lib/Parsers/IMGParser.rb b/lib/Parsers/IMGParser.rb index 22795f5..361ab53 100644 --- a/lib/Parsers/IMGParser.rb +++ b/lib/Parsers/IMGParser.rb @@ -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 != ""