ZMediumToMarkdown 2.1.6 → 2.1.7
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/Parsers/MarkupStyleRender.rb +20 -18
- 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: bb51b2e2b79015a9435e17913928e528af1f03a450211913307da00b0d996b96
|
4
|
+
data.tar.gz: 179de5ebddf33ae1e1758563ec24cccf3601afd5b6ce87a0c3a18aa5e6823ddd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b118c821db74a2fed2da4cc6b422fa3b01a4e100a0894c5a0b605fcdb18c2a25e9c2018de885b1cf81a5fbb07b894af25ebfe528db6339d749136511ab0d78c
|
7
|
+
data.tar.gz: 70d7929c1c0556319b9bb35d35915d1ef10380ad73f37b165642d506355175c0751daaffeabfbf0dc1fcb47df2f04ac621306d8465fb5e9d275aecaf50353929
|
@@ -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
|