slaw 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -4
- data/lib/slaw/grammars/inlines_nodes.rb +4 -4
- data/lib/slaw/version.rb +1 -1
- data/spec/za/act_inline_spec.rb +19 -0
- data/spec/za/act_table_spec.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4e592d61947fb6004d5d0107ec6614b4e4c46ff
|
4
|
+
data.tar.gz: 14def517ec227190a9d634eec8886ff3c215d84b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
80
|
-
3.
|
81
|
-
4.
|
82
|
-
5.
|
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
|
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
|
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
data/spec/za/act_inline_spec.rb
CHANGED
@@ -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 < 2 and 3 > 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 <between> angles</p>'
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
323
342
|
end
|
data/spec/za/act_table_spec.rb
CHANGED
@@ -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 > b</p>
|
353
|
+
</td>
|
354
|
+
<td>
|
355
|
+
<p>c & 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.
|
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-
|
11
|
+
date: 2018-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|