slaw 3.1.0 → 3.1.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
  SHA256:
3
- metadata.gz: 9caa9135d576212d4a7d6b2300bfe65fad7ef36cf938243f59ea002b25a41273
4
- data.tar.gz: faf61f38ee828b2d0f3024ca42ee7fe6ad560acfde021f1cdcbd1cfacdc73fd4
3
+ metadata.gz: 3403f22ffd64d8ab9ca92ad9e26fed22d0c38b9ab525cb0d91708c3f5e9a13d3
4
+ data.tar.gz: f2f40ece1aa1acc39bcb5cd2fdcda83449e883d98e86b6393433cb0284c060b0
5
5
  SHA512:
6
- metadata.gz: 7e69b0a96eb59ae723d8f3c217d7e0dfe13a236908f894061072a680d33e0e318496ec99f267672fcf49fb347cde79bc21c8bd9a2d449f315e6548b2f43cde84
7
- data.tar.gz: 380eb2d660d556715ce1339d841c44efe07c5c88271ae10bc4d9e44d648c420788c60137b917daf6f1768d745b273ad8fa3b7b6559ccec873f201b305c129e37
6
+ metadata.gz: fc3a1f6fb83768feb8d1ec85538a33fffdb5e2d9678fdcf72ced7be712385b47c07dd141ba8caaf92fbcaeb0410c418999eab547f30ab521fe1717e820f8684a
7
+ data.tar.gz: 8c961961f1e3e7f43400c5541c9afca35cc3d26edfa78977a5e846626b743150657bf0441df2c465e12f1df28dd35af110dcdce52b1a94ab1a643a6b7194da79
data/README.md CHANGED
@@ -1,11 +1,8 @@
1
1
  # Slaw [![Build Status](https://travis-ci.org/longhotsummer/slaw.svg)](http://travis-ci.org/longhotsummer/slaw) [![Gem Version](https://badge.fury.io/rb/slaw.svg)](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/OpenUpSA/indigo) and uses grammars developed for the legal
5
- traditions in these countries:
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
@@ -15,7 +15,6 @@ module Slaw
15
15
  end
16
16
 
17
17
  # one or more words, allowing inline elements
18
- # TODO: this is badly named, a better name would be inline_items
19
18
  rule inline_items
20
19
  inline_item+ <InlineItems>
21
20
  end
@@ -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) } if inline_items
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
 
@@ -1,3 +1,3 @@
1
1
  module Slaw
2
- VERSION = "3.1.0"
2
+ VERSION = "3.1.1"
3
3
  end
@@ -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.0
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-03-29 00:00:00.000000000 Z
11
+ date: 2019-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake