ZMediumToMarkdown 1.7.3 → 1.7.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a5c3a9b6f9ffba5bf008842145b31639e5e45aa3eebbd084cbe2a19ee767067
4
- data.tar.gz: 1f3c8807c99ce9a4ad8be93a5290dcce4c4bd6c7ad402ee2b57e74d90dbb35ab
3
+ metadata.gz: f8d93a8c503846adfc16a522538443ff0d7cccdac9f762e1820c6a126577ae01
4
+ data.tar.gz: ea3da670c30cb61dd06035f8a39983ff6d2e54a45273d0cc0da547e85102f47c
5
5
  SHA512:
6
- metadata.gz: 8eae3e52d955759153ad325b67ef373980779ac29510aab7387a602ebed59b3c53b447f8a3b93d15678c0f0c9e2ef647213370f0c89358bbab5d5f4d20387bcb
7
- data.tar.gz: 70da035f2fef37e46c9261860de82594b67989769f02acbde9597a66848cec69872b12e88a17545f2bb731d7c8b1c04912e2140ba716726cb7fd827b998d2485
6
+ metadata.gz: 855b53acb24236730b4812e48af9b4126efd925a154e72247a69a3fc8204f10f2ac8b1a7021a56b20eeef64e6b64d19822df9dd9f35a935ce7f238140f5ddbe2
7
+ data.tar.gz: 3fb8201543caee6f2e6621492db112a951863f5c93b9f6a0f5ac7c592aebbcabfbfdbdbf5d57329d6bfafe3611ce84c2225ef78236248dd020b13efd952f2990
@@ -40,7 +40,7 @@ class Main
40
40
  Helper.printNewVersionMessageIfExists()
41
41
  end
42
42
 
43
- opts.on('-kpPOST_URL', '--jekyllPostURL=POST_URL', 'Downloading single post with Jekyll friendly') do |postURL|
43
+ opts.on('-kPOST_URL', '--jekyllPostURL=POST_URL', 'Downloading single post with Jekyll friendly') do |postURL|
44
44
  outputFilePath = PathPolicy.new(filePath, "/")
45
45
  fetcher.isForJekyll = true
46
46
  fetcher.downloadPost(postURL, outputFilePath)
@@ -23,21 +23,28 @@ class IMGParser < Parser
23
23
  imagePathPolicy = PathPolicy.new(pathPolicy.getAbsolutePath(nil), paragraph.postID)
24
24
  absolutePath = imagePathPolicy.getAbsolutePath(fileName)
25
25
 
26
- comment = ""
27
- if paragraph.text != ""
28
- comment = " \"#{paragraph.text}\""
26
+ result = ""
27
+ alt = ""
28
+ if paragraph.orgText != ""
29
+ alt = " \"#{paragraph.orgText}\""
29
30
  end
30
31
 
31
32
  if ImageDownloader.download(absolutePath, imageURL)
32
33
  relativePath = "#{pathPolicy.getRelativePath(nil)}/#{imagePathPolicy.getRelativePath(fileName)}"
33
34
  if isForJekyll
34
- "\r\n![#{paragraph.text}](/#{relativePath}#{comment})\r\n"
35
+ result = "\r\n![#{paragraph.orgText}](/#{relativePath}#{alt})\r\n"
35
36
  else
36
- "\r\n![#{paragraph.text}](#{relativePath}#{comment})\r\n"
37
+ result = "\r\n![#{paragraph.orgText}](#{relativePath}#{alt})\r\n"
37
38
  end
38
39
  else
39
- "\r\n![#{paragraph.text}](#{imageURL}#{comment})\r\n"
40
+ result = "\r\n![#{paragraph.orgText}](#{imageURL}#{alt})\r\n"
40
41
  end
42
+
43
+ if paragraph.text != ""
44
+ result += "#{paragraph.text}\r\n"
45
+ end
46
+
47
+ result
41
48
  else
42
49
  if !nextParser.nil?
43
50
  nextParser.parse(paragraph)
@@ -7,10 +7,12 @@ class PQParser < Parser
7
7
  attr_accessor :nextParser
8
8
  def parse(paragraph)
9
9
  if paragraph.type == 'PQ'
10
- result = ""
10
+ result = "\r\n\r\n"
11
11
  paragraph.text.each_line do |p|
12
12
  result += "> #{p}"
13
13
  end
14
+ result += "\r\n\r\n"
15
+
14
16
  result
15
17
  else
16
18
  if !nextParser.nil?
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: 1.7.3
4
+ version: 1.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhgChgLi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-11 00:00:00.000000000 Z
11
+ date: 2022-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri