ZMediumToMarkdown 1.7.7 → 1.7.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Models/Paragraph.rb +4 -3
- data/lib/Parsers/IMGParser.rb +5 -5
- data/lib/Parsers/MIXTAPEEMBEDParser.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38b611d86bc16468f228c710b5b7f2732b49da2178991b676c957e0aa1b8a245
|
4
|
+
data.tar.gz: fcda6c6684aad98c3b00e4d2009f4c7dc9e18a05f5a9b699a9cbee1052a2caa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36400640d1cf148e68b1852076ef0099a8f2100aaab8ad15d20848c081ad7f10db113f7ca18589eda27392d8a006e72c7f6ffe725b0f755b566883801da4fff2
|
7
|
+
data.tar.gz: 4c5341aaf24828956de14b9e4c60d88a98fabd99147069393f1d3695a3423de4cd6a5a75372cc375b8431d9cd418248db19a8c987408dafa1371c7a33d974630
|
data/lib/Models/Paragraph.rb
CHANGED
@@ -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
|
-
|
69
|
-
@
|
69
|
+
orgTextWithEscape = Helper.escapeMarkdown(json['text'])
|
70
|
+
@orgTextWithEscape = orgTextWithEscape
|
70
71
|
|
71
72
|
if json['metadata'].nil?
|
72
73
|
@metadata = nil
|
data/lib/Parsers/IMGParser.rb
CHANGED
@@ -25,19 +25,19 @@ class IMGParser < Parser
|
|
25
25
|
|
26
26
|
result = ""
|
27
27
|
alt = ""
|
28
|
-
if paragraph.
|
29
|
-
alt = " \"#{paragraph.
|
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.
|
35
|
+
result = "\r\n![#{paragraph.orgTextWithEscape}](/#{relativePath}#{alt})\r\n"
|
36
36
|
else
|
37
|
-
result = "\r\n![#{paragraph.
|
37
|
+
result = "\r\n![#{paragraph.orgTextWithEscape}](#{relativePath}#{alt})\r\n"
|
38
38
|
end
|
39
39
|
else
|
40
|
-
result = "\r\n![#{paragraph.
|
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.
|
11
|
+
"\n[#{paragraph.orgTextWithEscape}](#{paragraph.mixtapeMetadata.href})"
|
12
12
|
else
|
13
|
-
"\n#{paragraph.
|
13
|
+
"\n#{paragraph.text}"
|
14
14
|
end
|
15
15
|
else
|
16
16
|
if !nextParser.nil?
|