ZMediumToMarkdown 2.0.7 → 2.0.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 +4 -4
- data/bin/ZMediumToMarkdown +7 -2
- data/lib/Parsers/MarkupStyleRender.rb +3 -3
- data/lib/ZMediumFetcher.rb +1 -1
- 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: 15f4bb468ab40811678a1a7b38dc51aa6e442b28a8da0b3835dce158f6d90fd4
|
|
4
|
+
data.tar.gz: 67715feec8e9e7c9f798a61e61529e7846b2db42c86d0c8bd9dd43f3d2de971d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 84f8eece59e468fb75768af6ed756dd96812ea81d8c6e6ecaeabf2c090db5f5bea10c39e8fc8693720322681f5ec902966371d4a95476f6f30ac8ada0782702e
|
|
7
|
+
data.tar.gz: 66c66d9b514fd8b0c81776e3dff2a466e91d291ebd9c466de8f6ca8ad19e7ba1d89aa154fa768e746194031805bf8722dbb8f0569b143e2700d04b550c0ce35f
|
data/bin/ZMediumToMarkdown
CHANGED
|
@@ -76,7 +76,7 @@ end
|
|
|
76
76
|
begin
|
|
77
77
|
puts "#https://github.com/ZhgChgLi/ZMediumToMarkdown"
|
|
78
78
|
puts "You have read and agree with the Disclaimer."
|
|
79
|
-
Main.new()
|
|
79
|
+
#Main.new()
|
|
80
80
|
puts "Execute Successfully!!!"
|
|
81
81
|
puts "#https://github.com/ZhgChgLi/ZMediumToMarkdown"
|
|
82
82
|
puts "#Thanks for using this tool."
|
|
@@ -86,4 +86,9 @@ rescue => e
|
|
|
86
86
|
puts e.backtrace
|
|
87
87
|
puts "#Please feel free to open an Issue or submit a fix/contribution via Pull Request on:\n"
|
|
88
88
|
puts "#https://github.com/ZhgChgLi/ZMediumToMarkdown\n"
|
|
89
|
-
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
obj = JSON.parse('{ "id": "e41429008434_63", "name": "35a0", "type": "ULI", "href": null, "layout": null, "metadata": null, "text": "[New] Customer reviews", "hasDropCap": null, "dropCapImage": null, "markups": [ { "type": "A", "start": 6, "end": 22, "href": "https://developer.apple.com/documentation/appstoreconnectapi/app_store/customer_reviews", "anchorType": "LINK", "userId": null, "linkMetadata": null, "__typename": "Markup" }, { "type": "STRONG", "start": 0, "end": 6, "href": null, "anchorType": null, "userId": null, "linkMetadata": null, "__typename": "Markup" } ], "__typename": "Paragraph", "iframe": null, "mixtapeMetadata": null }')
|
|
92
|
+
p = Paragraph.new(obj, "100")
|
|
93
|
+
r = MarkupParser.new(p, false)
|
|
94
|
+
puts r.parse()
|
|
@@ -171,11 +171,11 @@ class MarkupStyleRender
|
|
|
171
171
|
if markup.type == "EM"
|
|
172
172
|
tag = TagChar.new(2, markup.start, markup.end, "_", "_")
|
|
173
173
|
elsif markup.type == "CODE"
|
|
174
|
-
tag = TagChar.new(
|
|
174
|
+
tag = TagChar.new(0, markup.start, markup.end, "`", "`")
|
|
175
175
|
elsif markup.type == "STRONG"
|
|
176
176
|
tag = TagChar.new(2, markup.start, markup.end, "**", "**")
|
|
177
177
|
elsif markup.type == "ESCAPE"
|
|
178
|
-
escapeTagChar = TagChar.new(
|
|
178
|
+
escapeTagChar = TagChar.new(999,markup.start, markup.end,'','')
|
|
179
179
|
escapeTagChar.startChars = TextChar.new('\\'.chars,'Text')
|
|
180
180
|
escapeTagChar.endChars = TextChar.new([],'Text')
|
|
181
181
|
|
|
@@ -193,7 +193,7 @@ class MarkupStyleRender
|
|
|
193
193
|
if !lastPath.nil?
|
|
194
194
|
lastQuery = lastPath.split("-").last
|
|
195
195
|
end
|
|
196
|
-
|
|
196
|
+
|
|
197
197
|
if !usersPostURLs.nil? && !usersPostURLs.find { |usersPostURL| usersPostURL.split("/").last.split("-").last == lastQuery }.nil?
|
|
198
198
|
if isForJekyll
|
|
199
199
|
url = "(../#{lastQuery}/)"
|
data/lib/ZMediumFetcher.rb
CHANGED
|
@@ -233,7 +233,7 @@ class ZMediumFetcher
|
|
|
233
233
|
if lines.first.start_with?("---")
|
|
234
234
|
dateLine = lines.select { |line| line.start_with?("last_modified_at:") }.first
|
|
235
235
|
if !dateLine.nil?
|
|
236
|
-
fileLatestPublishedAt = Time.parse(dateLine[/^(last_modified_at:)\s+(\S*)/, 2]).to_i
|
|
236
|
+
#fileLatestPublishedAt = Time.parse(dateLine[/^(last_modified_at:)\s+(\S*)/, 2]).to_i
|
|
237
237
|
end
|
|
238
238
|
end
|
|
239
239
|
end
|