ZMediumToMarkdown 2.0.7 → 2.0.10

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: 411d9f653e728ad8708bfdd0738e181de68085865a3860e5d5272125236e856c
4
- data.tar.gz: 94c713a02a605b480bf63e1022a4ee53dcfca3fe4355daf401b2253354f6f194
3
+ metadata.gz: 3b9c991933c802ea5089c22fe1de06dbcc4d7e121ccdd4f95c1c29368da4d309
4
+ data.tar.gz: ece588c2c5b60ad45b93c75c2362b717167782c491ee6b4a7c0ec5d2b3122119
5
5
  SHA512:
6
- metadata.gz: 1b90384c75f6de2b1fcaaac3fcc1f3885ec6bf223698ce677c7cd621eec479eabead53794eb66d7ce2367867ef187468c733473e1e42a711eadf360a249a5803
7
- data.tar.gz: 89c9ec47b56b047042a060716f923ad1924722d17c842ccce954252976d8112cac0c3d610f7626caadd1a4eaada5031dea17ca26dea4349e2b8e9e2ca1431b1c
6
+ metadata.gz: 9fdee119b831c25f6b8040a5338ad722808ed58f0009dd13deb9424d3b30aba4cbc45bf143dd3669c8cb76a2d3527a6a16d46442a3f6480fc56ea0d98461d862
7
+ data.tar.gz: b1d53026f922219e610a6a20e3e155bf38a1223396d97d5709c908869e718fa05bf03042fcf0bc996a1bbed906142afb7d16818198622f13193887392066e80d
@@ -171,11 +171,11 @@ class MarkupStyleRender
171
171
  if markup.type == "EM"
172
172
  tag = TagChar.new(2, markup.start, markup.end, "_", "_")
173
173
  elsif markup.type == "CODE"
174
- tag = TagChar.new(3, markup.start, markup.end, "`", "`")
174
+ tag = TagChar.new(0, markup.start, markup.end, "`", "`")
175
175
  elsif markup.type == "STRONG"
176
176
  tag = TagChar.new(2, markup.start, markup.end, "**", "**")
177
177
  elsif markup.type == "ESCAPE"
178
- escapeTagChar = TagChar.new(0,markup.start, markup.end,'','')
178
+ escapeTagChar = TagChar.new(999,markup.start, markup.end,'','')
179
179
  escapeTagChar.startChars = TextChar.new('\\'.chars,'Text')
180
180
  escapeTagChar.endChars = TextChar.new([],'Text')
181
181
 
@@ -193,7 +193,7 @@ class MarkupStyleRender
193
193
  if !lastPath.nil?
194
194
  lastQuery = lastPath.split("-").last
195
195
  end
196
-
196
+
197
197
  if !usersPostURLs.nil? && !usersPostURLs.find { |usersPostURL| usersPostURL.split("/").last.split("-").last == lastQuery }.nil?
198
198
  if isForJekyll
199
199
  url = "(../#{lastQuery}/)"
@@ -250,9 +250,17 @@ class MarkupStyleRender
250
250
 
251
251
  startTags = tags.select { |tag| tag.startIndex == index }.sort_by(&:sort)
252
252
  if !startTags.nil?
253
+ hasCodeBlockTag = false
253
254
  startTags.each do |tag|
254
- response.append(tag.startChars)
255
+ if !hasCodeBlockTag
256
+ response.append(tag.startChars)
257
+ end
258
+
255
259
  stack.append(tag)
260
+
261
+ if tag.startChars.chars.join() == "`"
262
+ hasCodeBlockTag = true
263
+ end
256
264
  end
257
265
  end
258
266
 
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: 2.0.7
4
+ version: 2.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhgChgLi