asciidoctor-fb2 0.2.2 → 0.2.3

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: a4c7f00f477ddb1d95bb04eb0a834308288cae185c008ee0206197c9c4403d95
4
- data.tar.gz: '08772d526c95b49df5956b0ba12868aa58e4c1684b5e947aa5e233ee222c891f'
3
+ metadata.gz: bcbbc6c8b9fbfbb6eb2444a9054f8676aed178409809cc47977bccdd5011e94c
4
+ data.tar.gz: 5fd22ce5a853988ce66c483637b1b2fe0ca42154d2ab4ee0b277bbb84a96fa7b
5
5
  SHA512:
6
- metadata.gz: 56fbb9d6633d5b3ed3b55fc1b9aa8698c4805ddacae41c44cd376952e998ad89d379fb44bca7fa5ff42454ff6bec7cd717100b7408e013850c762bde7df0bedf
7
- data.tar.gz: 63a52028f548239dcc0d349f2d1ae8d371f53618c56aa47b04acb3eb1c42b9a93276dd579752d3ce143f36f61548b421e1f681d83ef47db3788cde303488aa0b
6
+ metadata.gz: b18f69261c30b1c486c6ef2ec41df8ef23e45ccb818cdc1869d5e525dc67eb841bbb83e51b473e5c6d50a868535a49530b0ac260c790597254df01656b1bb859
7
+ data.tar.gz: bbe16778d9bc390c7d492bea0a9588ac24bc9a67490d74950ccf68c65e699f42a0f4112b42d67c1a8aca472dae335ca038a529caaf087f6017f5bfad7e04c1e3
@@ -7,6 +7,12 @@
7
7
  This document provides a high-level view of the changes to the {project-name} by release.
8
8
  For a detailed view of what has changed, refer to the {uri-project}/commits/master[commit history] on GitHub.
9
9
 
10
+ == 0.2.3 (2020-11-24) - @slonopotamus
11
+
12
+ * add support for literal blocks
13
+ * fix crash for `menu` inline macro without submenu. https://github.com/slonopotamus/asciidoctor-fb2/issues/15[#15]
14
+ * add initial support for sidebar
15
+
10
16
  == 0.2.2 (2020-11-24) - @slonopotamus
11
17
 
12
18
  * do not crash on inline line break macro. https://github.com/slonopotamus/asciidoctor-fb2/issues/14[#14]
@@ -137,7 +137,7 @@ module Asciidoctor
137
137
  # @param node [Asciidoctor::Block]
138
138
  def convert_verse(node)
139
139
  body = node.content&.split("\n\n")&.map do |stanza|
140
- %(<stanza>\n<v>#{stanza.split("\n").join("</v>\n<v>")}</v>\n</stanza>)
140
+ %(<stanza>\n<v>#{stanza.split("\n") * "</v>\n<v>"}</v>\n</stanza>)
141
141
  end&.join("\n")
142
142
 
143
143
  citetitle = node.attr('citetitle')
@@ -155,6 +155,11 @@ module Asciidoctor
155
155
 
156
156
  # @param node [Asciidoctor::Block]
157
157
  def convert_listing(node)
158
+ convert_literal(node)
159
+ end
160
+
161
+ # @param node [Asciidoctor::Block]
162
+ def convert_literal(node)
158
163
  lines = []
159
164
  node.content.split("\n").each do |line|
160
165
  lines << %(<p><code>#{line}</code></p>)
@@ -186,11 +191,11 @@ module Asciidoctor
186
191
  caret = '&#160;<strong>&#8250;</strong> '
187
192
  menu = node.attr('menu')
188
193
  menuitem = node.attr('menuitem')
189
- submenus = node.attr('submenus').join(%(</b>#{caret}<b>))
194
+ submenus = node.attr('submenus') * %(</b>#{caret}<b>)
190
195
 
191
196
  result = %(<strong>#{menu}</strong>)
192
- result += %(#{caret}<strong>#{submenus}</strong>) unless submenus.empty?
193
- result += %(#{caret}<strong>#{menuitem}</strong>) unless menuitem.empty?
197
+ result += %(#{caret}<strong>#{submenus}</strong>) unless submenus.nil_or_empty?
198
+ result += %(#{caret}<strong>#{menuitem}</strong>) unless menuitem.nil_or_empty?
194
199
 
195
200
  result
196
201
  end
@@ -207,7 +212,7 @@ module Asciidoctor
207
212
 
208
213
  # @param node [Asciidoctor::Inline]
209
214
  def convert_inline_kbd(node)
210
- %(<strong>#{node.attr('keys').join('</strong>+<strong>')}</strong>)
215
+ %(<strong>#{node.attr('keys') * '</strong>+<strong>'}</strong>)
211
216
  end
212
217
 
213
218
  # @param node [Asciidoctor::Inline]
@@ -287,6 +292,13 @@ module Asciidoctor
287
292
  lines * "\n"
288
293
  end
289
294
 
295
+ # @param node [Asciidoctor::Block]
296
+ def convert_sidebar(node)
297
+ title_tag = node.title.nil_or_empty? ? '' : %(<p><strong>#{node.title}</strong></p>)
298
+ %(#{title_tag}
299
+ #{node.content})
300
+ end
301
+
290
302
  # @param node [Asciidoctor::List]
291
303
  def convert_ulist(node)
292
304
  lines = []
@@ -365,7 +377,7 @@ module Asciidoctor
365
377
  when :literal
366
378
  %(<p><pre>#{cell.text}</pre></p>)
367
379
  else
368
- (cell_content = cell.content).empty? ? '' : %(<p>#{cell_content.join "</p>\n<p>"}</p>)
380
+ (cell_content = cell.content).empty? ? '' : %(<p>#{cell_content * "</p>\n<p>"}</p>)
369
381
  end
370
382
  end
371
383
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module FB2
5
- VERSION = '0.2.2'
5
+ VERSION = '0.2.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-fb2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marat Radchenko