ZMediumToMarkdown 3.3.0 → 3.3.2
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/Parsers/MarkupParser.rb +7 -9
- data/lib/Parsers/MarkupStyleRender.rb +13 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 813d1a1a35814cecef527aaf22c240be7f360ce85f126beeab6d657e8522d394
|
|
4
|
+
data.tar.gz: 86ec6aed8871fd32efb7c72585d0ff629a565ba7a49befaa94d206890b8e0982
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ee20b0f247b35c99b7506f4ee861f1c31eeae3e9ce580cfffb42ac39bb7e88b591ea30fd79a6fb8e30302a2ac46aa3bad7c3d6556f6d6f47e40c6308e379f48b
|
|
7
|
+
data.tar.gz: 77e92d160f0847782ced16ae84acd48739b47225e4782a514db787d4a4ae36b384bafb7ffb9754c4549a29a8f8940dbbb7dadd97767d5ec741e9ea62dfd4ece5
|
data/lib/Parsers/MarkupParser.rb
CHANGED
|
@@ -14,15 +14,13 @@ class MarkupParser
|
|
|
14
14
|
|
|
15
15
|
def parse()
|
|
16
16
|
result = paragraph.text
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Helper.makeWarningText("Error occurred during render markup text, please help to open an issue on github.")
|
|
25
|
-
end
|
|
17
|
+
markupRender = MarkupStyleRender.new(paragraph, isForJekyll)
|
|
18
|
+
markupRender.usersPostURLs = usersPostURLs
|
|
19
|
+
begin
|
|
20
|
+
result = markupRender.parse()
|
|
21
|
+
rescue => e
|
|
22
|
+
puts e.backtrace
|
|
23
|
+
Helper.makeWarningText("Error occurred during render markup text, please help to open an issue on github.")
|
|
26
24
|
end
|
|
27
25
|
|
|
28
26
|
result
|
|
@@ -57,7 +57,19 @@ class MarkupStyleRender
|
|
|
57
57
|
|
|
58
58
|
def parse
|
|
59
59
|
if paragraph.markups.nil? || paragraph.markups.empty?
|
|
60
|
-
|
|
60
|
+
# No markup tags ⇒ walkCharsWithTags is skipped. For Jekyll
|
|
61
|
+
# output we still need to HTML-escape `<` / `>` so kramdown
|
|
62
|
+
# doesn't treat raw chars in the source text as bare HTML tags.
|
|
63
|
+
# Non-Jekyll output keeps the chars as-is.
|
|
64
|
+
response = if isForJekyll
|
|
65
|
+
chars.values.map do |c|
|
|
66
|
+
next c if c.chars.empty?
|
|
67
|
+
escaped = Helper.escapeHTML(c.chars.join, true)
|
|
68
|
+
TextChar.new(escaped.chars, "Text")
|
|
69
|
+
end
|
|
70
|
+
else
|
|
71
|
+
chars.values
|
|
72
|
+
end
|
|
61
73
|
else
|
|
62
74
|
tags = buildTags(paragraph.markups).sort_by(&:startIndex)
|
|
63
75
|
response = walkCharsWithTags(tags)
|