ZMediumToMarkdown 2.3.6 → 2.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Helper.rb +8 -3
- data/lib/ImageDownloader.rb +4 -0
- data/lib/Parsers/MarkupParser.rb +0 -4
- data/lib/Parsers/MarkupStyleRender.rb +4 -2
- 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: 6aa04febbe53fb63849ed9bc0fdd83c1e30b67e808f42899e9ec2d4772db57bd
|
4
|
+
data.tar.gz: '09fb6a627ecb9c320b114113713464871d60fe1e2c32810ecba4c77ea11e5381'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e58ac4d9c2f00113e9446594f75067c2f9a48a3c8c35f2ef752da024c19e18c77eb3f03f816b53a7c0c8fd6603b2790d08cd5986e6de7d858c555f0d17c9e91
|
7
|
+
data.tar.gz: eab3c050b0fdc2cfc0c85518cabdc4d9d3a1eda6de220046639fb76ccdb133540e9408640a1dec9b48574933f465d130b988fe072af6b40e79a78cd719b065db
|
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
|
-
|
28
|
-
|
26
|
+
def self.escapeHTML(text, toHTMLEntity = true)
|
27
|
+
if toHTMLEntity
|
28
|
+
text = text.gsub(/(<)/, '<')
|
29
|
+
text = text.gsub(/(>)/, '>')
|
30
|
+
else
|
31
|
+
text = text.gsub(/(<)/, '\<')
|
32
|
+
text = text.gsub(/(>)/, '\>')
|
33
|
+
end
|
29
34
|
text
|
30
35
|
end
|
31
36
|
|
data/lib/ImageDownloader.rb
CHANGED
data/lib/Parsers/MarkupParser.rb
CHANGED
@@ -267,11 +267,13 @@ class MarkupStyleRender
|
|
267
267
|
end
|
268
268
|
|
269
269
|
if char.chars.join() != "\n"
|
270
|
-
if
|
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 =
|
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
|
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.
|
4
|
+
version: 2.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ZhgChgLi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|