slaw 0.7.0 → 0.7.1

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
  SHA1:
3
- metadata.gz: abd66cac7464d7d0e76983e97002f39e0ad85b6e
4
- data.tar.gz: 681cfe499a8e96bc7183415b2ab795e834efa48a
3
+ metadata.gz: ab0729eacd76a7bf7f4cd639986b5a892a635125
4
+ data.tar.gz: c9994dc951d991553f55709a22cd8d21e6bb9aa7
5
5
  SHA512:
6
- metadata.gz: e1cc2cdbb8626fe61e8f688100d2b1c32b12772aadd4166f766c346fa27c69549358696b50e06797968f52ec1a7e9ce28df75060b8f4648ceca55dd280581dac
7
- data.tar.gz: 485ddceb9b8efd4b8f9275735603e8c1edcbce766b6c541d82c1a0801a53045b83da833ab5e057b628e533f31d1fc97f13b84c4e03441a06ef3c393922cfeda9
6
+ metadata.gz: 4d40d3cba28815aed221a31216dc6d337300f0cc74925e816f974c5a42e3e427a88b2a18010aafb554bc9b9ffc4fe691b7d4bcadeadfee6022bb198e2425c469
7
+ data.tar.gz: 42653d4f00bf24f9d7345938255ab49d725ef197adda131410d7317dd8d30dcec34f61cf66c6da48dcffbaf57fd63a61398973c332cd98a9d763c3a3d80cf734
data/lib/slaw/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slaw
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
@@ -143,7 +143,7 @@ module Slaw
143
143
 
144
144
  def title
145
145
  if heading.text_value and heading.respond_to? :content
146
- heading.content.text_value
146
+ heading.content.text_value.strip
147
147
  end
148
148
  end
149
149
 
@@ -180,7 +180,7 @@ module Slaw
180
180
 
181
181
  def title
182
182
  if heading.text_value and heading.respond_to? :content
183
- heading.content.text_value
183
+ heading.content.text_value.strip
184
184
  end
185
185
  end
186
186
 
data/spec/za/act_spec.rb CHANGED
@@ -191,6 +191,28 @@ EOS
191
191
  </content>
192
192
  </subsection>
193
193
  </section>
194
+ </chapter>'
195
+ end
196
+
197
+ it 'should handle whitespace in chapter titles' do
198
+ node = parse :chapter, <<EOS
199
+ Chapter 2
200
+ The Chapter Heading
201
+ 1. Section
202
+ Hello there
203
+ EOS
204
+ to_xml(node).should == '<chapter id="chapter-2">
205
+ <num>2</num>
206
+ <heading>The Chapter Heading</heading>
207
+ <section id="section-1">
208
+ <num>1.</num>
209
+ <heading>Section</heading>
210
+ <subsection id="section-1.subsection-0">
211
+ <content>
212
+ <p>Hello there</p>
213
+ </content>
214
+ </subsection>
215
+ </section>
194
216
  </chapter>'
195
217
  end
196
218
  end
@@ -284,6 +306,28 @@ EOS
284
306
  </part>'
285
307
  end
286
308
 
309
+ it 'should handle part headers with whitespace' do
310
+ node = parse :part, <<EOS
311
+ Part 2
312
+ The Part Heading
313
+ 1. Section
314
+ Hello there
315
+ EOS
316
+ to_xml(node).should == '<part id="part-2">
317
+ <num>2</num>
318
+ <heading>The Part Heading</heading>
319
+ <section id="section-1">
320
+ <num>1.</num>
321
+ <heading>Section</heading>
322
+ <subsection id="section-1.subsection-0">
323
+ <content>
324
+ <p>Hello there</p>
325
+ </content>
326
+ </subsection>
327
+ </section>
328
+ </part>'
329
+ end
330
+
287
331
  it 'should handle parts and odd section numbers' do
288
332
  subject.parser.options = {section_number_after_title: false}
289
333
  node = parse :parts, <<EOS
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slaw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Kempe