ZMediumToMarkdown 1.6.2 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57ebbd86d072c9c43a5baef02031561323e9e7f6857e639aecc754de5741c543
4
- data.tar.gz: 03bde3f39434b21c7d96380d05dbc9ccc7096f30ab97aade0e6838165e28de3e
3
+ metadata.gz: a289a9d9178f9001eb97db354501e6112331be901a629719c775a28098268cc9
4
+ data.tar.gz: f116778fbd8a33287c289a905eb9026620f6d601953446cf946858ed3d108576
5
5
  SHA512:
6
- metadata.gz: d108f648afe9eb0f90231dc771e22fd6f3f15d820f6d19aa941d23b48b2416c672350b6353af85c58dd13ccc1c3faa194b55f622476d09ea8bc84cccff6ba6ac
7
- data.tar.gz: e484a2d51bc9ec006dc5511e2586d29eaab102bf778a030240ee92941b4fdfd9a726fbc5542677af7dbd8bb192e6c5d162b30b8c8b5001d166d3561edabdb9ec
6
+ metadata.gz: c4efcdb20c64941fc5b800c4029088179a65e0298a78a21ee68d6a967738a487395948cade619dd6420e075c882df5744373e7c661e7d47cc92b5a3ac1e8722b
7
+ data.tar.gz: 133737ccac50e0d5cddac1ea10ef10cb6e46ca972a195160b6451a04f38d6a18171fd62849769ad159bbd227614495fe4a6d7c59b5a0d60892cb0373f44b5b16
@@ -25,9 +25,9 @@ class IMGParser < Parser
25
25
 
26
26
  if ImageDownloader.download(absolutePath, imageURL)
27
27
  relativePath = "#{pathPolicy.getRelativePath(nil)}/#{imagePathPolicy.getRelativePath(fileName)}"
28
- "![#{paragraph.text}](/#{relativePath}#{comment})"
28
+ "\r\n![#{paragraph.text}](#{relativePath}#{comment})\r\n"
29
29
  else
30
- "![#{paragraph.text}](#{imageURL}#{comment})"
30
+ "\r\n![#{paragraph.text}](#{imageURL}#{comment})\r\n"
31
31
  end
32
32
  else
33
33
  if !nextParser.nil?
@@ -35,9 +35,9 @@ class IframeParser < Parser
35
35
  title = paragraph.iframe.title
36
36
  if ImageDownloader.download(absolutePath, imageURL)
37
37
  relativePath = "#{pathPolicy.getRelativePath(nil)}/#{imagePathPolicy.getRelativePath(fileName)}"
38
- result = "\n[![#{title}](#{relativePath} \"#{title}\")](#{params["url"]})"
38
+ result = "\r\n[![#{title}](#{relativePath} \"#{title}\")](#{params["url"]})\r\n"
39
39
  else
40
- result = "\n[#{title}](#{params["url"]})"
40
+ result = "\r\n[#{title}](#{params["url"]})\r\n"
41
41
  end
42
42
  end
43
43
  else
@@ -23,7 +23,7 @@ class LinkParser
23
23
 
24
24
  postPath = link.split("/").last
25
25
  if !usersPostURLs.find { |usersPostURL| usersPostURL.split("/").last.split("-").last == postPath.split("-").last }.nil?
26
- markdownString = markdownString.sub! link, "../#{postPath}"
26
+ markdownString = markdownString.sub! link, "#{postPath}"
27
27
  end
28
28
  end
29
29
  end
@@ -32,12 +32,10 @@ class MarkupStyleRender
32
32
  chars = {}
33
33
  index = 0
34
34
 
35
- emojiRegex = /[\u{203C}\u{2049}\u{20E3}\u{2122}\u{2139}\u{2194}-\u{2199}\u{21A9}-\u{21AA}\u{231A}-\u{231B}\u{23E9}-\u{23EC}\u{23F0}\u{23F3}\u{24C2}\u{25AA}-\u{25AB}\u{25B6}\u{25C0}\u{25FB}-\u{25FE}\u{2600}-\u{2601}\u{260E}\u{2611}\u{2614}-\u{2615}\u{261D}\u{263A}\u{2648}-\u{2653}\u{2660}\u{2663}\u{2665}-\u{2666}\u{2668}\u{267B}\u{267F}\u{2693}\u{26A0}-\u{26A1}\u{26AA}-\u{26AB}\u{26BD}-\u{26BE}\u{26C4}-\u{26C5}\u{26CE}\u{26D4}\u{26EA}\u{26F2}-\u{26F3}\u{26F5}\u{26FA}\u{26FD}\u{2702}\u{2705}\u{2708}-\u{270C}\u{270F}\u{2712}\u{2714}\u{2716}\u{2728}\u{2733}-\u{2734}\u{2744}\u{2747}\u{274C}\u{274E}\u{2753}-\u{2755}\u{2757}\u{2764}\u{2795}-\u{2797}\u{27A1}\u{27B0}\u{2934}-\u{2935}\u{2B05}-\u{2B07}\u{2B1B}-\u{2B1C}\u{2B50}\u{2B55}\u{3030}\u{303D}\u{3297}\u{3299}\u{1F004}\u{1F0CF}\u{1F170}-\u{1F171}\u{1F17E}-\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E7}-\u{1F1EC}\u{1F1EE}-\u{1F1F0}\u{1F1F3}\u{1F1F5}\u{1F1F7}-\u{1F1FA}\u{1F201}-\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}-\u{1F251}\u{1F300}-\u{1F320}\u{1F330}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F380}-\u{1F393}\u{1F3A0}-\u{1F3C4}\u{1F3C6}-\u{1F3CA}\u{1F3E0}-\u{1F3F0}\u{1F400}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4F7}\u{1F4F9}-\u{1F4FC}\u{1F500}-\u{1F507}\u{1F509}-\u{1F53D}\u{1F550}-\u{1F567}\u{1F5FB}-\u{1F640}\u{1F645}-\u{1F64F}\u{1F680}-\u{1F68A}]/
36
- excludesEmojis = ["⚠"]
37
35
  paragraph.text.each_char do |char|
38
36
  chars[index] = TextChar.new([char], "Text")
39
37
  index += 1
40
- if char =~ emojiRegex && !excludesEmojis.include?(char)
38
+ if char.bytes.length >= 4
41
39
  # some emoji need more space (in Medium)
42
40
  chars[index] = TextChar.new([], "Text")
43
41
  index += 1
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: 1.6.2
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhgChgLi