ZMediumToMarkdown 2.3.6 → 2.3.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/Helper.rb +8 -3
- 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: a97b61290289e8989c8bd6283be69f1e8167636b0489d7af46b66a5ec7307936
|
4
|
+
data.tar.gz: 9d270ec137cf4cae7438f9038ec79fa7bd09748e891d82aeda47d0ed4fd4f1dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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/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.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-
|
11
|
+
date: 2024-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|