ZMediumToMarkdown 1.7.7 → 1.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f34b1b96683e25673872ff046d9baaeda079d595d5163fbcf894e0fc3bf340c
4
- data.tar.gz: e852a11256fe0789472182bb43d0cb9a15f75439676043703dc368e0a153e06a
3
+ metadata.gz: 38b611d86bc16468f228c710b5b7f2732b49da2178991b676c957e0aa1b8a245
4
+ data.tar.gz: fcda6c6684aad98c3b00e4d2009f4c7dc9e18a05f5a9b699a9cbee1052a2caa9
5
5
  SHA512:
6
- metadata.gz: 7ba230c20dfd3f9638ed837f7a989de1c0fa0309db3865390d6b7616c6f2dcc0321c70acc49875128fb83225d8a892e51ffe7726d06c7311aae30830841d843d
7
- data.tar.gz: f8936158de2a595047cf989f7fabaed2602aec4502f2e2480bef81659980f08ead77e0647a024d1eb4efb72cf4614448abada9d7cecec5741960a8aeb98f5048
6
+ metadata.gz: 36400640d1cf148e68b1852076ef0099a8f2100aaab8ad15d20848c081ad7f10db113f7ca18589eda27392d8a006e72c7f6ffe725b0f755b566883801da4fff2
7
+ data.tar.gz: 4c5341aaf24828956de14b9e4c60d88a98fabd99147069393f1d3695a3423de4cd6a5a75372cc375b8431d9cd418248db19a8c987408dafa1371c7a33d974630
@@ -5,7 +5,7 @@ require 'Parsers/PParser'
5
5
  require 'securerandom'
6
6
 
7
7
  class Paragraph
8
- attr_accessor :postID, :name, :orgText, :text, :type, :href, :metadata, :mixtapeMetadata, :iframe, :oliIndex, :markups, :markupLinks
8
+ attr_accessor :postID, :name, :orgText, :orgTextWithEscape, :text, :type, :href, :metadata, :mixtapeMetadata, :iframe, :oliIndex, :markups, :markupLinks
9
9
 
10
10
  class Iframe
11
11
  attr_accessor :id, :title, :type, :src
@@ -61,12 +61,13 @@ class Paragraph
61
61
  def initialize(json, postID)
62
62
  @name = json['name']
63
63
  @text = json['text']
64
+ @orgText = json['text']
64
65
  @type = json['type']
65
66
  @href = json['href']
66
67
  @postID = postID
67
68
 
68
- orgText = Helper.escapeMarkdown(json['text'])
69
- @orgText = orgText
69
+ orgTextWithEscape = Helper.escapeMarkdown(json['text'])
70
+ @orgTextWithEscape = orgTextWithEscape
70
71
 
71
72
  if json['metadata'].nil?
72
73
  @metadata = nil
@@ -25,19 +25,19 @@ class IMGParser < Parser
25
25
 
26
26
  result = ""
27
27
  alt = ""
28
- if paragraph.orgText != ""
29
- alt = " \"#{paragraph.orgText}\""
28
+ if paragraph.orgTextWithEscape != ""
29
+ alt = " \"#{paragraph.orgTextWithEscape}\""
30
30
  end
31
31
 
32
32
  if ImageDownloader.download(absolutePath, imageURL)
33
33
  relativePath = "#{pathPolicy.getRelativePath(nil)}/#{imagePathPolicy.getRelativePath(fileName)}"
34
34
  if isForJekyll
35
- result = "\r\n![#{paragraph.orgText}](/#{relativePath}#{alt})\r\n"
35
+ result = "\r\n![#{paragraph.orgTextWithEscape}](/#{relativePath}#{alt})\r\n"
36
36
  else
37
- result = "\r\n![#{paragraph.orgText}](#{relativePath}#{alt})\r\n"
37
+ result = "\r\n![#{paragraph.orgTextWithEscape}](#{relativePath}#{alt})\r\n"
38
38
  end
39
39
  else
40
- result = "\r\n![#{paragraph.orgText}](#{imageURL}#{alt})\r\n"
40
+ result = "\r\n![#{paragraph.orgTextWithEscape}](#{imageURL}#{alt})\r\n"
41
41
  end
42
42
 
43
43
  if paragraph.text != ""
@@ -8,9 +8,9 @@ class MIXTAPEEMBEDParser < Parser
8
8
  def parse(paragraph)
9
9
  if paragraph.type == 'MIXTAPE_EMBED'
10
10
  if !paragraph.mixtapeMetadata.nil? && !paragraph.mixtapeMetadata.href.nil?
11
- "\n[#{paragraph.orgText}](#{paragraph.mixtapeMetadata.href})"
11
+ "\n[#{paragraph.orgTextWithEscape}](#{paragraph.mixtapeMetadata.href})"
12
12
  else
13
- "\n#{paragraph.orgText}"
13
+ "\n#{paragraph.text}"
14
14
  end
15
15
  else
16
16
  if !nextParser.nil?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ZMediumToMarkdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.7
4
+ version: 1.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhgChgLi