asciidoctor-fb2 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 210abe6551fe7da1d9b89221086ccf555b0415e14ffec68915c859ba3b05bf5a
4
- data.tar.gz: 92d848355114858d43682c963606466c0f5e07bfcbcaf65e1436aa6cb34cecca
3
+ metadata.gz: a4c7f00f477ddb1d95bb04eb0a834308288cae185c008ee0206197c9c4403d95
4
+ data.tar.gz: '08772d526c95b49df5956b0ba12868aa58e4c1684b5e947aa5e233ee222c891f'
5
5
  SHA512:
6
- metadata.gz: 4ca271531be2ecfe832f45bfe25ba0ddfb69c938fd19acb4b9edde6f31c4d1f7b6efee4bc87c00429a9cfd8d3841acd1ecfe78c39fdea3cf5d2a14490a3b3306
7
- data.tar.gz: 68d20bc6f6fae5ba45c036fff85377294801c37bbf0abbc0c47fbf965aee74cfe8517e67c324ace6a96d26e801b1626564043ee6ef8d87d61d11f7742df6f5f1
6
+ metadata.gz: 56fbb9d6633d5b3ed3b55fc1b9aa8698c4805ddacae41c44cd376952e998ad89d379fb44bca7fa5ff42454ff6bec7cd717100b7408e013850c762bde7df0bedf
7
+ data.tar.gz: 63a52028f548239dcc0d349f2d1ae8d371f53618c56aa47b04acb3eb1c42b9a93276dd579752d3ce143f36f61548b421e1f681d83ef47db3788cde303488aa0b
@@ -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.2 (2020-11-24) - @slonopotamus
11
+
12
+ * do not crash on inline line break macro. https://github.com/slonopotamus/asciidoctor-fb2/issues/14[#14]
13
+ * add support for verses
14
+ * add support for quotes
15
+
10
16
  == 0.2.1 (2020-11-24) - @slonopotamus
11
17
 
12
18
  * add support for `kbd` inline macro. https://github.com/slonopotamus/asciidoctor-fb2/issues/13[#13]
@@ -119,6 +119,40 @@ module Asciidoctor
119
119
  lines * "\n"
120
120
  end
121
121
 
122
+ # @param node [Asciidoctor::Block]
123
+ def convert_quote(node)
124
+ citetitle = node.attr('citetitle')
125
+ citetitle_tag = citetitle.nil_or_empty? ? '' : %(<subtitle>#{citetitle}</subtitle>)
126
+
127
+ author = node.attr('attribution')
128
+ author_tag = author.nil_or_empty? ? '' : %(<text-author>#{node.attr('attribution')}</text-author>)
129
+
130
+ %(<cite>
131
+ #{citetitle_tag}
132
+ <p>#{node.content}</p>
133
+ #{author_tag}
134
+ </cite>)
135
+ end
136
+
137
+ # @param node [Asciidoctor::Block]
138
+ def convert_verse(node)
139
+ body = node.content&.split("\n\n")&.map do |stanza|
140
+ %(<stanza>\n<v>#{stanza.split("\n").join("</v>\n<v>")}</v>\n</stanza>)
141
+ end&.join("\n")
142
+
143
+ citetitle = node.attr('citetitle')
144
+ citetitle_tag = citetitle.nil_or_empty? ? '' : %(<title>#{citetitle}</title>)
145
+
146
+ author = node.attr('attribution')
147
+ author_tag = author.nil_or_empty? ? '' : %(<text-author>#{node.attr('attribution')}</text-author>)
148
+
149
+ %(<poem>
150
+ #{citetitle_tag}
151
+ #{body}
152
+ #{author_tag}
153
+ </poem>)
154
+ end
155
+
122
156
  # @param node [Asciidoctor::Block]
123
157
  def convert_listing(node)
124
158
  lines = []
@@ -161,6 +195,11 @@ module Asciidoctor
161
195
  result
162
196
  end
163
197
 
198
+ # @param node [Asciidoctor::Inline]
199
+ def convert_inline_break(node)
200
+ node.text
201
+ end
202
+
164
203
  # @param node [Asciidoctor::Inline]
165
204
  def convert_inline_button(node)
166
205
  %([<strong>#{node.text}</strong>])
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module FB2
5
- VERSION = '0.2.1'
5
+ VERSION = '0.2.2'
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.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marat Radchenko