ZMediumToMarkdown 2.3.5 → 2.3.7

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: 9ac2efdeeb24471dd51d7630bda99b10c0d48db4fdf235327db9f9cf56e6c1ec
4
- data.tar.gz: 5bf7d2ff10d80a99927bb3d4aec617da5bd34214f547b7a353070b0430442c30
3
+ metadata.gz: a97b61290289e8989c8bd6283be69f1e8167636b0489d7af46b66a5ec7307936
4
+ data.tar.gz: 9d270ec137cf4cae7438f9038ec79fa7bd09748e891d82aeda47d0ed4fd4f1dd
5
5
  SHA512:
6
- metadata.gz: 79116422eb468eb84427bba2341909ef8b2b0a617308280fb13bf70eb814268e4789cf04ece4ea1b3f2b6bfcc5ecbfa108d98fc78378486d0608801d0ffb2320
7
- data.tar.gz: 7d4a8f4377e29d2a74e71fdda53c1bfb53cc00a9196f18780e9b1cbe1010d36765022dcdd5bbdee6a114a4b77f5b0671dfe25d6d3237836f6333c3db10f62842
6
+ metadata.gz: 16767e5244986c9ece667ce4c6f26a2a676253b1421a202a4a2820225dd248b249d6df424474ae400c851f6c30c7011c0379384d2e3f7bd52060809cfde807e4
7
+ data.tar.gz: 9616218726f4dcea5d00cbbb5ad75fe15ae9c6aa2eae1f29232fc9c27eef5bccc7da3ca056caef791098ff044f2262ee4946e613212a22d431011e1f712bbb17
data/lib/Helper.rb CHANGED
@@ -23,9 +23,14 @@ class Helper
23
23
  text.gsub(/(\*|_|`|\||\\|\{|\}|\[|\]|\(|\)|#|\+|\-|\.|\!)/){ |x| "\\#{x}" }
24
24
  end
25
25
 
26
- def self.escapeHTML(text)
27
- text = text.gsub(/(<)/, '&lt;')
28
- text = text.gsub(/(>)/, '&gt;')
26
+ def self.escapeHTML(text, toHTMLEntity = true)
27
+ if toHTMLEntity
28
+ text = text.gsub(/(<)/, '&lt;')
29
+ text = text.gsub(/(>)/, '&gt;')
30
+ else
31
+ text = text.gsub(/(<)/, '\<')
32
+ text = text.gsub(/(>)/, '\>')
33
+ end
29
34
  text
30
35
  end
31
36
 
@@ -26,10 +26,6 @@ class MarkupParser
26
26
  Helper.makeWarningText("Error occurred during render markup text, please help to open an issue on github.")
27
27
  end
28
28
  end
29
-
30
- if isForJekyll
31
- result = Helper.escapeHTML(result)
32
- end
33
29
 
34
30
  result
35
31
  end
@@ -267,11 +267,13 @@ class MarkupStyleRender
267
267
  end
268
268
 
269
269
  if char.chars.join() != "\n"
270
- if !stack.select { |tag| tag.startChars.chars.join() == "`" }.nil?
270
+ if stack.select { |tag| tag.startChars.chars.join() == "`" }.length > 0
271
271
  # is in code block
272
272
  response.append(char)
273
273
  else
274
- resultChar = Helper.escapeMarkdown(char.chars.join())
274
+ resultChar = char.chars.join()
275
+ resultChar = Helper.escapeHTML(resultChar, isForJekyll)
276
+
275
277
  response.append(TextChar.new(resultChar.chars, "Text"))
276
278
  end
277
279
  end
data/lib/User.rb CHANGED
@@ -39,8 +39,6 @@ class User
39
39
  body = Request.body(Request.URL("https://medium.com/_/graphql", "POST", query))
40
40
  json = JSON.parse(body)
41
41
 
42
- puts body
43
-
44
42
  nextInfo = json&.dig(0, "data", "userResult", "homepagePostsConnection", "pagingInfo", "next")
45
43
  postsInfo = json&.dig(0, "data", "userResult", "homepagePostsConnection", "posts")
46
44
 
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.3.5
4
+ version: 2.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhgChgLi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-15 00:00:00.000000000 Z
11
+ date: 2024-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri