slaw 3.1.0 → 3.1.1
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 +4 -4
- data/README.md +6 -5
- data/lib/slaw/grammars/inlines.treetop +0 -1
- data/lib/slaw/grammars/inlines_nodes.rb +1 -5
- data/lib/slaw/grammars/za/act.treetop +1 -1
- data/lib/slaw/version.rb +1 -1
- data/spec/za/act_block_spec.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3403f22ffd64d8ab9ca92ad9e26fed22d0c38b9ab525cb0d91708c3f5e9a13d3
|
4
|
+
data.tar.gz: f2f40ece1aa1acc39bcb5cd2fdcda83449e883d98e86b6393433cb0284c060b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc3a1f6fb83768feb8d1ec85538a33fffdb5e2d9678fdcf72ced7be712385b47c07dd141ba8caaf92fbcaeb0410c418999eab547f30ab521fe1717e820f8684a
|
7
|
+
data.tar.gz: 8c961961f1e3e7f43400c5541c9afca35cc3d26edfa78977a5e846626b743150657bf0441df2c465e12f1df28dd35af110dcdce52b1a94ab1a643a6b7194da79
|
data/README.md
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
# Slaw [](http://travis-ci.org/longhotsummer/slaw) [](https://badge.fury.io/rb/slaw)
|
2
2
|
|
3
3
|
Slaw is a lightweight library for generating Akoma Ntoso 2.0 Act XML from plain text documents.
|
4
|
-
It is used to power [Indigo](https://github.com/
|
5
|
-
|
6
|
-
|
7
|
-
* South Africa
|
8
|
-
* Poland
|
4
|
+
It is used to power [Indigo](https://github.com/laws-africa/indigo) and uses grammars developed for the legal
|
5
|
+
tradition in South Africa, although others traditions are supported.
|
9
6
|
|
10
7
|
Slaw allows you to:
|
11
8
|
|
@@ -84,6 +81,10 @@ You can create your own grammar by creating a gem that provides these files and
|
|
84
81
|
|
85
82
|
## Changelog
|
86
83
|
|
84
|
+
### 3.1.1 (?)
|
85
|
+
|
86
|
+
* FIX don't error when a line is just a backslash
|
87
|
+
|
87
88
|
### 3.1.0 (29 March 2019)
|
88
89
|
|
89
90
|
* Add --ascii flag to %-encode utf-8 strings into US-ASCII for speed. See https://github.com/cjheath/treetop/issues/31
|
@@ -3,11 +3,7 @@ module Slaw
|
|
3
3
|
module Inlines
|
4
4
|
class NakedStatement < Treetop::Runtime::SyntaxNode
|
5
5
|
def to_xml(b, idprefix, i=0)
|
6
|
-
b.p { |b| inline_items.to_xml(b, idprefix) }
|
7
|
-
end
|
8
|
-
|
9
|
-
def content
|
10
|
-
inline_items
|
6
|
+
b.p { |b| inline_items.to_xml(b, idprefix) } unless inline_items.empty?
|
11
7
|
end
|
12
8
|
end
|
13
9
|
|
@@ -178,7 +178,7 @@ module Slaw
|
|
178
178
|
# and is ignored. This allows escaping of section headings, etc.
|
179
179
|
|
180
180
|
rule naked_statement
|
181
|
-
space? !(chapter_heading / part_heading / section_title / schedule_title / subsection_prefix / crossheading) '\\'? inline_items eol
|
181
|
+
space? !(chapter_heading / part_heading / section_title / schedule_title / subsection_prefix / crossheading) '\\'? inline_items:inline_items? eol
|
182
182
|
<NakedStatement>
|
183
183
|
end
|
184
184
|
|
data/lib/slaw/version.rb
CHANGED
data/spec/za/act_block_spec.rb
CHANGED
@@ -1375,6 +1375,25 @@ EOS
|
|
1375
1375
|
</section>'
|
1376
1376
|
end
|
1377
1377
|
|
1378
|
+
it 'should handle escaped empty lines' do
|
1379
|
+
node = parse :section, <<EOS
|
1380
|
+
1. Section
|
1381
|
+
|
1382
|
+
\\
|
1383
|
+
|
1384
|
+
stuff
|
1385
|
+
EOS
|
1386
|
+
to_xml(node, "").should == '<section id="section-1">
|
1387
|
+
<num>1.</num>
|
1388
|
+
<heading>Section</heading>
|
1389
|
+
<paragraph id="section-1.paragraph0">
|
1390
|
+
<content>
|
1391
|
+
<p>stuff</p>
|
1392
|
+
</content>
|
1393
|
+
</paragraph>
|
1394
|
+
</section>'
|
1395
|
+
end
|
1396
|
+
|
1378
1397
|
it 'should not clash with dotted subsections' do
|
1379
1398
|
node = parse :section, <<EOS
|
1380
1399
|
3. Types of informal trading
|
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: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Kempe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|