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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e19605bba5d079fa1086c14dfb33c7d33f36da86b46c6c6c97affc960521d26
4
- data.tar.gz: 96e13a36f2573d2dae057ee7a318ad66d9d09dc69990deff5bf5033a72032f8c
3
+ metadata.gz: 813d1a1a35814cecef527aaf22c240be7f360ce85f126beeab6d657e8522d394
4
+ data.tar.gz: 86ec6aed8871fd32efb7c72585d0ff629a565ba7a49befaa94d206890b8e0982
5
5
  SHA512:
6
- metadata.gz: 81e76d2686c7f06976ea9fdcb09243b75e5f628669e3c405b27a636705d6a54862f264c569bc4e33bcf571d3ba6696ed578b20a45350ea81fb993b605d76e860
7
- data.tar.gz: 34d756095ba13548c551da107d9e4903b51d094087ce8ac71ed140f52adf0e3a852afbe35bae15b27c09ed08cafb4df91fc121bdf7e262b123e989b3053af8bb
6
+ metadata.gz: ee20b0f247b35c99b7506f4ee861f1c31eeae3e9ce580cfffb42ac39bb7e88b591ea30fd79a6fb8e30302a2ac46aa3bad7c3d6556f6d6f47e40c6308e379f48b
7
+ data.tar.gz: 77e92d160f0847782ced16ae84acd48739b47225e4782a514db787d4a4ae36b384bafb7ffb9754c4549a29a8f8940dbbb7dadd97767d5ec741e9ea62dfd4ece5
@@ -14,15 +14,13 @@ class MarkupParser
14
14
 
15
15
  def parse()
16
16
  result = paragraph.text
17
- if !paragraph.markups.nil? && paragraph.markups.length > 0
18
- markupRender = MarkupStyleRender.new(paragraph, isForJekyll)
19
- markupRender.usersPostURLs = usersPostURLs
20
- begin
21
- result = markupRender.parse()
22
- rescue => e
23
- puts e.backtrace
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
- response = chars.values
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)
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: 3.3.0
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhgChgLi