ZMediumToMarkdown 2.1.6 → 2.1.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/lib/Helper.rb +1 -1
- data/lib/Parsers/MarkupStyleRender.rb +20 -18
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e8f852c73a60ac2d43c28c9fed9b7c217df4b1afc34e77e14f73b9b949ba7530
|
|
4
|
+
data.tar.gz: cd7aae4e3b23d662fed1f89d7c078b141e947a06c816f6e53e954f2752b726e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 25b1b6aa357c4cca7cb588da0668d181ade6ab89cee7556ad8dd1190c4c98a9e08d3ed88ff9354fe885da65a582bb97d1df0f1a753bf68f33ecbc64c6a0f10dc
|
|
7
|
+
data.tar.gz: 80dc1d96a5af95aa3940d77f7e166fe1d113ff5b729c428658101629518827f46312dbdc216a1343e1eada0d5162931f66ef563e81b5c8a42ec7a67a218fcaa7
|
data/lib/Helper.rb
CHANGED
|
@@ -117,7 +117,7 @@ class Helper
|
|
|
117
117
|
result += "description: \"#{postInfo.description&.gsub("\"", "\\\"")}\"\n"
|
|
118
118
|
if !postInfo.previewImage.nil?
|
|
119
119
|
result += "image:\r\n"
|
|
120
|
-
result += " path:
|
|
120
|
+
result += " path: /#{postInfo.previewImage}\r\n"
|
|
121
121
|
end
|
|
122
122
|
if isForJekyll
|
|
123
123
|
result += "render_with_liquid: false\n"
|
|
@@ -197,28 +197,30 @@ class MarkupStyleRender
|
|
|
197
197
|
elsif markup.anchorType == "USER"
|
|
198
198
|
url = "https://medium.com/u/#{markup.userId}"
|
|
199
199
|
end
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if !usersPostURLs.nil? && !usersPostURLs.find { |usersPostURL| usersPostURL.split("/").last.split("-").last == lastQuery }.nil?
|
|
208
|
-
if isForJekyll
|
|
209
|
-
url = "(../#{lastQuery}/)"
|
|
210
|
-
else
|
|
211
|
-
url = "(#{lastPath})"
|
|
200
|
+
|
|
201
|
+
if url =~ /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,6}(:[0-9]{1,5})?(\/.*)?$/ix
|
|
202
|
+
lastPath = url.split("/").last
|
|
203
|
+
lastQuery = nil
|
|
204
|
+
if !lastPath.nil?
|
|
205
|
+
lastQuery = lastPath.split("-").last
|
|
212
206
|
end
|
|
213
|
-
|
|
214
|
-
if
|
|
215
|
-
|
|
207
|
+
|
|
208
|
+
if !usersPostURLs.nil? && !usersPostURLs.find { |usersPostURL| usersPostURL.split("/").last.split("-").last == lastQuery }.nil?
|
|
209
|
+
if isForJekyll
|
|
210
|
+
url = "(../#{lastQuery}/)"
|
|
211
|
+
else
|
|
212
|
+
url = "(#{lastPath})"
|
|
213
|
+
end
|
|
216
214
|
else
|
|
217
|
-
|
|
215
|
+
if isForJekyll
|
|
216
|
+
url = "(#{url}){:target=\"_blank\"}"
|
|
217
|
+
else
|
|
218
|
+
url = "(#{url})"
|
|
219
|
+
end
|
|
218
220
|
end
|
|
221
|
+
|
|
222
|
+
tag = TagChar.new(1, markup.start, markup.end, "[", "]#{url}")
|
|
219
223
|
end
|
|
220
|
-
|
|
221
|
-
tag = TagChar.new(1, markup.start, markup.end, "[", "]#{url}")
|
|
222
224
|
else
|
|
223
225
|
Helper.makeWarningText("Undefined Markup Type: #{markup.type}.")
|
|
224
226
|
end
|
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: 2.1.
|
|
4
|
+
version: 2.1.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ZhgChgLi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-03-
|
|
11
|
+
date: 2023-03-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|