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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86e5929087cc7fbd4567db3c7e5c54735208388d92673453070e93b585788f33
4
- data.tar.gz: 0353e4a182eb2470162b314b431f7381f9ed6dff8b99cf930532297bf3b96a82
3
+ metadata.gz: bb51b2e2b79015a9435e17913928e528af1f03a450211913307da00b0d996b96
4
+ data.tar.gz: 179de5ebddf33ae1e1758563ec24cccf3601afd5b6ce87a0c3a18aa5e6823ddd
5
5
  SHA512:
6
- metadata.gz: 3a12c25f931886137c601ab7e840d6acecc654d3c3bc405272ee1d0d78d8fba14d1aa8948ef46c3462ff13907fcb0a6a19bff44c7012122fb846c0797bf50bd9
7
- data.tar.gz: 2dda8f8bf3e82dcb8a5a59c2fb01ae24e91dd6c292bdf31cb22a0f65ab3ada6dcee2a1647f24f72ca04dac6011e2d816f87f71082e1e5be883c7f98dbcab0701
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
- lastPath = url.split("/").last
202
- lastQuery = nil
203
- if !lastPath.nil?
204
- lastQuery = lastPath.split("-").last
205
- end
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
- else
214
- if isForJekyll
215
- url = "(#{url}){:target=\"_blank\"}"
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
- url = "(#{url})"
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ZMediumToMarkdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.6
4
+ version: 2.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhgChgLi