slaw 1.0.2 → 1.0.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
  SHA1:
3
- metadata.gz: 144db68aa0eec37d77e0550a1f5b3d572513d1f7
4
- data.tar.gz: 4b0600effc6afa94eb5fbbdeb557c76c0ecf63da
3
+ metadata.gz: a4e592d61947fb6004d5d0107ec6614b4e4c46ff
4
+ data.tar.gz: 14def517ec227190a9d634eec8886ff3c215d84b
5
5
  SHA512:
6
- metadata.gz: c6edaf2914c46fae7a1c2b70178779937a0852dff1c4d28633011d79b71089cdaa830c8c10c2f8e47724c2b275b8672081fd4fbf3dd5b2649db795243ae377ce
7
- data.tar.gz: 1af8dd3c707f60cbf43c4b2667cf19e55b2cd38e9c5ec9502e593e4f0110e80f59900fa7c58b74f2f9777f7a977721ec06ad89ce8eb0eacaec5480dd02061e61
6
+ metadata.gz: 73477d04ec3e4dd5b8f6bec3dda12e20f723c0f66994d1b9d6ebab39a27e85427f8f70e89dc56046dc186c0e1c352a57ef930866e3cc0912eb6a43380493a34a
7
+ data.tar.gz: '013925d2e95abd44b07992f707e738c80d88cfe697c2ca9d03fafd04c9cfc4d0df242f73edc0fd5a1963b9dfa87feaaa123751418c86ff86f51cfa36f5a409bf'
data/README.md CHANGED
@@ -76,13 +76,24 @@ and parser.
76
76
  ## Contributing
77
77
 
78
78
  1. Fork it at http://github.com/longhotsummer/slaw/fork
79
- 2. Create your feature branch (`git checkout -b my-new-feature`)
80
- 3. Commit your changes (`git commit -am 'Add some feature'`)
81
- 4. Push to the branch (`git push origin my-new-feature`)
82
- 5. Create new Pull Request
79
+ 2. Install dependencies: `bundle install`
80
+ 3. Create your feature branch: `git checkout -b my-new-feature`
81
+ 4. Write great code!
82
+ 5. Run tests: `rspec`
83
+ 6. Commit your changes: `git commit -am 'Add some feature'`
84
+ 7. Push to the branch: `git push origin my-new-feature`
85
+ 8. Create a new Pull Request
83
86
 
84
87
  ## Changelog
85
88
 
89
+ ### 1.0.3 (26 September 2018)
90
+
91
+ * FIX bug in all grammars that dropped less-than symbols `<` from input text.
92
+
93
+ ### 1.0.2 (2 June 2018)
94
+
95
+ * FIX bug in ZA grammar when parsing dotted numbered subsections ending with a newline
96
+
86
97
  ### 1.0.1
87
98
 
88
99
  * Improved support for other legal traditions / grammars.
@@ -17,7 +17,7 @@ module Slaw
17
17
  if e.respond_to? :to_xml
18
18
  e.to_xml(b, idprefix)
19
19
  else
20
- b << e.text_value
20
+ b.text(e.text_value)
21
21
  end
22
22
  end
23
23
  end
@@ -26,15 +26,15 @@ module Slaw
26
26
  class Remark < Treetop::Runtime::SyntaxNode
27
27
  def to_xml(b, idprefix)
28
28
  b.remark(status: 'editorial') do |b|
29
- b << '['
29
+ b.text('[')
30
30
  for e in content.elements
31
31
  if e.respond_to? :to_xml
32
32
  e.to_xml(b, idprefix)
33
33
  else
34
- b << e.text_value
34
+ b.text(e.text_value)
35
35
  end
36
36
  end
37
- b << ']'
37
+ b.text(']')
38
38
  end
39
39
  end
40
40
  end
data/lib/slaw/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slaw
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -320,4 +320,23 @@ EOS
320
320
  end
321
321
  end
322
322
 
323
+ #-------------------------------------------------------------------------------
324
+ # inline statements
325
+
326
+ context 'inline_statements' do
327
+ it 'should handle less-than-chars' do
328
+ node = parse :inline_statement, <<EOS
329
+ Hello 1 < 2 and 3 > 2
330
+ EOS
331
+ to_xml(node, "").should == '<p>Hello 1 &lt; 2 and 3 &gt; 2</p>'
332
+ end
333
+
334
+ it 'should handle html-like text' do
335
+ node = parse :inline_statement, <<EOS
336
+ Stuff <between> angles
337
+ EOS
338
+ to_xml(node, "").should == '<p>Stuff &lt;between&gt; angles</p>'
339
+ end
340
+ end
341
+
323
342
  end
@@ -335,6 +335,26 @@ EOS
335
335
  <p><ref href="/a/b">link</ref> and<eol/><remark status="editorial">[comment]</remark></p>
336
336
  </td>
337
337
  </tr>
338
+ </table>'
339
+ end
340
+
341
+ it 'should manage entities in a table' do
342
+ node = parse :table, <<EOS
343
+ {|
344
+ | a > b
345
+ | c & d
346
+ |}
347
+ EOS
348
+
349
+ to_xml(node, '', 0).should == '<table id="table0">
350
+ <tr>
351
+ <td>
352
+ <p>a &gt; b</p>
353
+ </td>
354
+ <td>
355
+ <p>c &amp; d</p>
356
+ </td>
357
+ </tr>
338
358
  </table>'
339
359
  end
340
360
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slaw
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Kempe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-02 00:00:00.000000000 Z
11
+ date: 2018-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler