slaw 10.5.0 → 12.0.0

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: ba413f53b9d24192d6ce5a168eed83ca55a317dcb3768009cfdf3bf902a23327
4
- data.tar.gz: f664b13ce90bb21b65c0fffb2f780dc5937429c31ac2a9d6270259e0669f2f61
3
+ metadata.gz: c95f6f9b4e2611cd1418fd4f4b67b98b048b1821510af354fe1290bcf57e009e
4
+ data.tar.gz: 35ce02b5dbc2558937cf4378e6b426b42f988d313d09f372c688599322dacdf1
5
5
  SHA512:
6
- metadata.gz: 0f0929aa1fcce2c86f6340fec7731f5e865e0b58b793b4f7d64ba48ec2463299498b4b96fea3487a11ab57a2ae932273e27c593395cd2ca263347006fa36a88a
7
- data.tar.gz: 72aceb516d091bd396deeb828873058a3cda366524c3e1819590ae77f021ab9a806baf0108f1239dceaaf0e7a64713e1c954ec385b5ed03563f1d702cd4b0984
6
+ metadata.gz: 718ce963ef974c024a63d8b0c69d363cd260d34562d426cbc1779be76300380f9e9c06e1865a8598003853a847cb422ab90ca9c8962c3ed39c3189bdc3755429
7
+ data.tar.gz: 8770a53d488cfc624a563cdadf9f4c0c091d440a1f3920f290ce2f7abb8cfea2f8fd4e7e0931e8c81a287c6c46cf0a5c0a0a03dd7e39429009ebe1c0074a58c4
@@ -0,0 +1,22 @@
1
+ name: Test
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ matrix:
11
+ ruby-version: [2.7, 2.6]
12
+
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - name: Set up Ruby ${{ matrix.ruby-version }}
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: ${{ matrix.ruby-version }}
19
+ - name: Install dependencies
20
+ run: bundle install
21
+ - name: Run tests
22
+ run: bundle exec rake
data/README.md CHANGED
@@ -86,6 +86,23 @@ You can create your own grammar by creating a gem that provides these files and
86
86
 
87
87
  ## Changelog
88
88
 
89
+ ### 12.0.0 (31 January 2022)
90
+
91
+ * Use `<br/>` for newlines in tables, rather than `<eol/>`, since it's more semantically correct.
92
+
93
+ ### 11.0.0 (29 October 2021)
94
+
95
+ * Prefix eId attributes in attachments with attachement's eId
96
+ * Use crossHeading element for crossheadings
97
+
98
+ ### 10.7.0 (11 June 2021)
99
+
100
+ * Support underlines with `__text__`
101
+
102
+ ### 10.6.0 (10 May 2021)
103
+
104
+ * Handle sup and sub when extracting from HTML.
105
+
89
106
  ### 10.5.0 (20 April 2021)
90
107
 
91
108
  * Handle escaping inlines when unparsing.
@@ -11,9 +11,10 @@
11
11
 
12
12
  <xsl:template match="head|style|script|link" />
13
13
 
14
- <xsl:template match="ul|ol">
14
+ <!-- block containers that end with newlines -->
15
+ <xsl:template match="ul|ol|section|article|h1|h2|h3|h4|h5">
15
16
  <xsl:apply-templates />
16
- <xsl:text>&#10;</xsl:text>
17
+ <xsl:text>&#10;&#10;</xsl:text>
17
18
  </xsl:template>
18
19
 
19
20
  <xsl:template match="ul/li">
@@ -23,20 +24,23 @@
23
24
  <xsl:text>&#10;</xsl:text>
24
25
  </xsl:template>
25
26
 
27
+ <!-- numbered lists should include a number -->
26
28
  <xsl:template match="ol/li">
27
- <!-- 1. foo -->
29
+ <!-- \1. foo -->
28
30
  <xsl:text>\</xsl:text>
29
- <xsl:value-of select="position()" />
31
+ <xsl:choose>
32
+ <xsl:when test="@value">
33
+ <xsl:value-of select="@value" />
34
+ </xsl:when>
35
+ <xsl:otherwise>
36
+ <xsl:value-of select="position()" />
37
+ </xsl:otherwise>
38
+ </xsl:choose>
30
39
  <xsl:text>. </xsl:text>
31
40
  <xsl:apply-templates />
32
41
  <xsl:text>&#10;</xsl:text>
33
42
  </xsl:template>
34
43
 
35
- <xsl:template match="h1|h2|h3|h4|h5">
36
- <xsl:apply-templates />
37
- <xsl:text>&#10;&#10;</xsl:text>
38
- </xsl:template>
39
-
40
44
  <xsl:template match="p|div">
41
45
  <xsl:choose>
42
46
  <xsl:when test="starts-with(., '[') and substring(., string-length(.)) = ']'">
@@ -51,32 +55,27 @@
51
55
  <xsl:text>&#10;&#10;</xsl:text>
52
56
  </xsl:template>
53
57
 
58
+ <!-- START tables -->
59
+
54
60
  <xsl:template match="table">
55
61
  <xsl:text>{| </xsl:text>
56
- <xsl:text>
57
- |-</xsl:text>
62
+ <xsl:text>&#10;|-</xsl:text>
58
63
  <xsl:apply-templates />
59
- <xsl:text>
60
- |}
61
-
62
- </xsl:text>
64
+ <xsl:text>&#10;|}&#10;&#10;</xsl:text>
63
65
  </xsl:template>
64
66
 
65
67
  <xsl:template match="tr">
66
68
  <xsl:apply-templates />
67
- <xsl:text>
68
- |-</xsl:text>
69
+ <xsl:text>&#10;|-</xsl:text>
69
70
  </xsl:template>
70
71
 
71
72
  <xsl:template match="th|td">
72
73
  <xsl:choose>
73
74
  <xsl:when test="local-name(.) = 'th'">
74
- <xsl:text>
75
- ! </xsl:text>
75
+ <xsl:text>&#10;! </xsl:text>
76
76
  </xsl:when>
77
77
  <xsl:when test="local-name(.) = 'td'">
78
- <xsl:text>
79
- | </xsl:text>
78
+ <xsl:text>&#10;| </xsl:text>
80
79
  </xsl:when>
81
80
  </xsl:choose>
82
81
 
@@ -118,8 +117,15 @@
118
117
  </xsl:template>
119
118
 
120
119
  <xsl:template match="br">
121
- <xsl:text>
122
- </xsl:text>
120
+ <xsl:text>&#10;</xsl:text>
121
+ </xsl:template>
122
+
123
+ <xsl:template match="sup">
124
+ <xsl:text>^^</xsl:text><xsl:apply-templates /><xsl:text>^^</xsl:text>
125
+ </xsl:template>
126
+
127
+ <xsl:template match="sub">
128
+ <xsl:text>_^</xsl:text><xsl:apply-templates /><xsl:text>^_</xsl:text>
123
129
  </xsl:template>
124
130
 
125
131
 
@@ -20,7 +20,7 @@ module Slaw
20
20
  end
21
21
 
22
22
  rule inline_item
23
- remark / image / ref / bold / italics / superscript / subscript / '\\'? [^\n]
23
+ remark / image / ref / bold / italics / superscript / subscript / underline / '\\'? [^\n]
24
24
  <InlineItem>
25
25
  end
26
26
 
@@ -69,6 +69,12 @@ module Slaw
69
69
  <Subscript>
70
70
  end
71
71
 
72
+ rule underline
73
+ # __foo__
74
+ '__' content:(!'__' inline_item)+ '__'
75
+ <Underline>
76
+ end
77
+
72
78
  end
73
79
  end
74
80
  end
@@ -96,6 +96,15 @@ module Slaw
96
96
  end
97
97
  end
98
98
 
99
+ class Underline < Treetop::Runtime::SyntaxNode
100
+ def to_xml(b, idprefix)
101
+ b.u { |b|
102
+ for e in content.elements
103
+ e.inline_item.to_xml(b, idprefix)
104
+ end
105
+ }
106
+ end
107
+ end
99
108
  end
100
109
  end
101
110
  end
@@ -97,8 +97,9 @@ module Slaw
97
97
 
98
98
  # the schedule id is derived from the heading
99
99
  schedule_id = self.schedule_id(heading_text, i)
100
+ eId = "att_#{i}"
100
101
 
101
- b.attachment(eId: "att_#{i}") { |b|
102
+ b.attachment(eId: eId) { |b|
102
103
  schedule_title.to_xml(b, '', heading_text)
103
104
  b.doc_(name: "schedule") { |b|
104
105
  b.meta { |b|
@@ -128,7 +129,7 @@ module Slaw
128
129
  }
129
130
 
130
131
  b.mainBody { |b|
131
- body.children.elements.each_with_index { |e| e.to_xml(b, '', i) } if body.is_a? Body
132
+ body.children.elements.each_with_index { |e| e.to_xml(b, eId + "__", i) } if body.is_a? Body
132
133
  }
133
134
  }
134
135
  }
@@ -67,7 +67,7 @@ module Slaw
67
67
  # for the first line, eat whitespace at the start
68
68
  # for the last line, eat whitespace at the end
69
69
  if not tail and (i > 0 or not inline_items.empty?)
70
- eol.text_value.count("\n").times { b.eol }
70
+ eol.text_value.count("\n").times { b.br }
71
71
  end
72
72
  end
73
73
  end
@@ -234,8 +234,14 @@ module Slaw
234
234
  section_title.num
235
235
  end
236
236
 
237
- def to_xml(b, *args)
237
+ def to_xml(b, idprefix='', *args)
238
238
  id = "sec_#{Slaw::Grammars::Counters.clean(num)}"
239
+ # For historical reasons, we normally ignore the idprefix for sections, assuming
240
+ # them to be unique. However, in an attachment (eg. a schedule), ensure they
241
+ # are correctly prefixed
242
+ # TODO: always include the idprefix
243
+ id = idprefix + id if idprefix.start_with? 'att_'
244
+
239
245
  b.section(eId: id) { |b|
240
246
  section_title.to_xml(b)
241
247
 
@@ -371,13 +377,11 @@ module Slaw
371
377
 
372
378
  class Crossheading < Treetop::Runtime::SyntaxNode
373
379
  def to_xml(b, idprefix, i=0)
374
- cnt = Slaw::Grammars::Counters.counters[idprefix]['hcontainer'] += 1
375
- id = "#{idprefix}hcontainer_#{cnt}"
380
+ cnt = Slaw::Grammars::Counters.counters[idprefix]['crossHeading'] += 1
381
+ id = "#{idprefix}crossHeading_#{cnt}"
376
382
 
377
- b.hcontainer(eId: id, name: 'crossheading') { |b|
378
- b.heading { |b|
383
+ b.crossHeading(eId: id) { |b|
379
384
  inline_items.to_xml(b, idprefix)
380
- }
381
385
  }
382
386
  end
383
387
  end
@@ -59,13 +59,19 @@
59
59
  <xsl:call-template name="string-replace-all">
60
60
  <xsl:with-param name="text">
61
61
  <xsl:call-template name="string-replace-all">
62
- <xsl:with-param name="text" select="$text" />
63
- <xsl:with-param name="value"><xsl:value-of select="'\'" /></xsl:with-param>
64
- <xsl:with-param name="replacement"><xsl:value-of select="'\\'" /></xsl:with-param>
62
+ <xsl:with-param name="text">
63
+ <xsl:call-template name="string-replace-all">
64
+ <xsl:with-param name="text" select="$text" />
65
+ <xsl:with-param name="value"><xsl:value-of select="'\'" /></xsl:with-param>
66
+ <xsl:with-param name="replacement"><xsl:value-of select="'\\'" /></xsl:with-param>
67
+ </xsl:call-template>
68
+ </xsl:with-param>
69
+ <xsl:with-param name="value"><xsl:value-of select="'**'" /></xsl:with-param>
70
+ <xsl:with-param name="replacement"><xsl:value-of select="'\*\*'" /></xsl:with-param>
65
71
  </xsl:call-template>
66
72
  </xsl:with-param>
67
- <xsl:with-param name="value"><xsl:value-of select="'**'" /></xsl:with-param>
68
- <xsl:with-param name="replacement"><xsl:value-of select="'\*\*'" /></xsl:with-param>
73
+ <xsl:with-param name="value"><xsl:value-of select="'__'" /></xsl:with-param>
74
+ <xsl:with-param name="replacement"><xsl:value-of select="'\_\_'" /></xsl:with-param>
69
75
  </xsl:call-template>
70
76
  </xsl:with-param>
71
77
  <xsl:with-param name="value"><xsl:value-of select="'//'" /></xsl:with-param>
@@ -225,9 +231,9 @@
225
231
  </xsl:template>
226
232
 
227
233
  <!-- crossheadings -->
228
- <xsl:template match="a:hcontainer[@name='crossheading']">
234
+ <xsl:template match="a:crossHeading">
229
235
  <xsl:text>CROSSHEADING </xsl:text>
230
- <xsl:apply-templates select="a:heading" />
236
+ <xsl:apply-templates />
231
237
  <xsl:text>&#10;&#10;</xsl:text>
232
238
  </xsl:template>
233
239
 
@@ -293,7 +299,7 @@
293
299
  <xsl:text>&#10;</xsl:text>
294
300
  </xsl:if>
295
301
 
296
- <xsl:text>&#10;&#10;</xsl:text>
302
+ <xsl:text>&#10;</xsl:text>
297
303
  <xsl:apply-templates select="a:doc/a:mainBody" />
298
304
  </xsl:template>
299
305
 
@@ -397,7 +403,13 @@
397
403
  <xsl:text>^_</xsl:text>
398
404
  </xsl:template>
399
405
 
400
- <xsl:template match="a:eol">
406
+ <xsl:template match="a:u">
407
+ <xsl:text>__</xsl:text>
408
+ <xsl:apply-templates />
409
+ <xsl:text>__</xsl:text>
410
+ </xsl:template>
411
+
412
+ <xsl:template match="a:eol | a:br">
401
413
  <xsl:text>&#10;</xsl:text>
402
414
  </xsl:template>
403
415
 
data/lib/slaw/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slaw
2
- VERSION = "10.5.0"
2
+ VERSION = "12.0.0"
3
3
  end
@@ -18,3 +18,7 @@ nested ** stars in // italics \*\* // and bold **
18
18
 
19
19
  super ^^with \^\^ hats \^\^^^ and sub _^\_^ with \^_ end tokens \^_^_
20
20
 
21
+ underlines __underline with _ underscores__ and \_\_escaped underlines \_\_
22
+
23
+ mixed __underline **and \_\_ bold**__
24
+
@@ -240,17 +240,38 @@ Hello [there](/za/act/123) friend.
240
240
  '
241
241
  end
242
242
 
243
- it 'should replace eol with newlines in tables' do
243
+ it 'should unparse underlines correctly' do
244
+ doc = xml2doc(section(<<XML
245
+ <num>1.</num>
246
+ <paragraph id="section-19.paragraph-0">
247
+ <content>
248
+ <p>Hello <u>underlined</u>.</p>
249
+ </content>
250
+ </paragraph>
251
+ XML
252
+ ))
253
+
254
+ text = subject.text_from_act(doc)
255
+ text.should == 'BODY
256
+
257
+ 1.
258
+
259
+ Hello __underlined__.
260
+
261
+ '
262
+ end
263
+
264
+ it 'should replace eol and br with newlines in tables' do
244
265
  doc = xml2doc(section(<<XML
245
266
  <num>1.</num>
246
267
  <table eId="sec__21_table_1">
247
268
  <tr>
248
269
  <td>
249
- <p>foo<eol/>bar<eol/>baz</p>
270
+ <p>foo<eol/>bar<br/>baz</p>
250
271
  </td>
251
272
  <td>
252
273
  <p>
253
- one<eol/>two<eol/>three
274
+ one<br/>two<eol/>three
254
275
 
255
276
  </p>
256
277
  </td>
@@ -59,9 +59,7 @@ EOS
59
59
  <p>Hello there</p>
60
60
  </content>
61
61
  </hcontainer>
62
- <hcontainer eId="sec_1__hcontainer_2" name="crossheading">
63
- <heading>crossheading</heading>
64
- </hcontainer>
62
+ <crossHeading eId="sec_1__crossHeading_1">crossheading</crossHeading>
65
63
  </section>
66
64
  </body>'
67
65
  end
@@ -96,9 +94,7 @@ EOS
96
94
  </blockList>
97
95
  </content>
98
96
  </hcontainer>
99
- <hcontainer eId="hcontainer_2" name="crossheading">
100
- <heading>crossheading</heading>
101
- </hcontainer>
97
+ <crossHeading eId="crossHeading_1">crossheading</crossHeading>
102
98
  <section eId="sec_1">
103
99
  <num>1.</num>
104
100
  <heading>Section</heading>
@@ -107,9 +103,7 @@ EOS
107
103
  <p>Hello there</p>
108
104
  </content>
109
105
  </hcontainer>
110
- <hcontainer eId="sec_1__hcontainer_2" name="crossheading">
111
- <heading>crossheading</heading>
112
- </hcontainer>
106
+ <crossHeading eId="sec_1__crossHeading_1">crossheading</crossHeading>
113
107
  </section>
114
108
  </body>'
115
109
  end
@@ -260,10 +254,8 @@ EOS
260
254
  to_xml(node).should == '<chapter eId="chp_2">
261
255
  <num>2</num>
262
256
  <heading>The Chapter Heading</heading>
263
- <hcontainer eId="chp_2__hcontainer_1" name="crossheading">
264
- <heading>crossheading</heading>
265
- </hcontainer>
266
- <hcontainer eId="chp_2__hcontainer_2" name="hcontainer">
257
+ <crossHeading eId="chp_2__crossHeading_1">crossheading</crossHeading>
258
+ <hcontainer eId="chp_2__hcontainer_1" name="hcontainer">
267
259
  <content>
268
260
  <p>Some lines at the start of the chapter.</p>
269
261
  </content>
@@ -489,9 +481,7 @@ EOS
489
481
  to_xml(node).should == '<part eId="part_2">
490
482
  <num>2</num>
491
483
  <heading>The Part Heading</heading>
492
- <hcontainer eId="part_2__hcontainer_1" name="crossheading">
493
- <heading>crossheading</heading>
494
- </hcontainer>
484
+ <crossHeading eId="part_2__crossHeading_1">crossheading</crossHeading>
495
485
  <section eId="sec_1">
496
486
  <num>1.</num>
497
487
  <heading>Section</heading>
@@ -1872,9 +1862,7 @@ EOS
1872
1862
  context 'crossheadings' do
1873
1863
  it 'should handle a inline_items in crossheadings' do
1874
1864
  node = parse :crossheading, "CROSSHEADING something [[remark]] [link](/foo/bar)\n"
1875
- to_xml(node, '').should == '<hcontainer eId="hcontainer_1" name="crossheading">
1876
- <heading>something <remark status="editorial">[remark]</remark> <ref href="/foo/bar">link</ref></heading>
1877
- </hcontainer>'
1865
+ to_xml(node, '').should == '<crossHeading eId="crossHeading_1">something <remark status="editorial">[remark]</remark> <ref href="/foo/bar">link</ref></crossHeading>'
1878
1866
  end
1879
1867
 
1880
1868
  it 'should not be allowed in preface' do
@@ -1924,9 +1912,7 @@ Text
1924
1912
  <p>Some text</p>
1925
1913
  </preface>
1926
1914
  <body>
1927
- <hcontainer eId="hcontainer_1" name="crossheading">
1928
- <heading>In the body</heading>
1929
- </hcontainer>
1915
+ <crossHeading eId="crossHeading_1">In the body</crossHeading>
1930
1916
  <section eId="sec_1">
1931
1917
  <num>1.</num>
1932
1918
  <heading>Section 1</heading>
@@ -1987,9 +1973,7 @@ Text
1987
1973
  <p>Some text</p>
1988
1974
  </preamble>
1989
1975
  <body>
1990
- <hcontainer eId="hcontainer_1" name="crossheading">
1991
- <heading>In the body</heading>
1992
- </hcontainer>
1976
+ <crossHeading eId="crossHeading_1">In the body</crossHeading>
1993
1977
  <section eId="sec_1">
1994
1978
  <num>1.</num>
1995
1979
  <heading>Section 1</heading>
@@ -197,7 +197,7 @@ EOS
197
197
  </identification>
198
198
  </meta>
199
199
  <mainBody>
200
- <hcontainer eId="hcontainer_1" name="hcontainer">
200
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
201
201
  <content>
202
202
  <p>
203
203
  <remark status="editorial">[Schedule 1 added by Act 23 of 2004]</remark>
@@ -535,4 +535,17 @@ EOS
535
535
  end
536
536
  end
537
537
 
538
+ describe 'underline' do
539
+ it 'should handle underline' do
540
+ node = parse :generic_container, <<EOS
541
+ Text __with underline__ and _ under__scores__.
542
+ EOS
543
+ to_xml(node, "").should == '<hcontainer eId="hcontainer_1" name="hcontainer">
544
+ <content>
545
+ <p>Text <u>with underline</u> and _ under<u>scores</u>.</p>
546
+ </content>
547
+ </hcontainer>'
548
+ end
549
+ end
550
+
538
551
  end
@@ -88,11 +88,11 @@ EOS
88
88
  </identification>
89
89
  </meta>
90
90
  <mainBody>
91
- <section eId="sec_1">
91
+ <section eId="att_1__sec_1">
92
92
  <num>1.</num>
93
93
  <heading>Foo</heading>
94
94
  </section>
95
- <section eId="sec_2">
95
+ <section eId="att_1__sec_2">
96
96
  <num>2.</num>
97
97
  <heading>Bar</heading>
98
98
  </section>
@@ -129,7 +129,7 @@ EOS
129
129
  </identification>
130
130
  </meta>
131
131
  <mainBody>
132
- <hcontainer eId="hcontainer_1" name="hcontainer">
132
+ <hcontainer eId="att_2__hcontainer_1" name="hcontainer">
133
133
  <content>
134
134
  <p>Baz</p>
135
135
  <p>Boom</p>
@@ -186,16 +186,16 @@ EOS
186
186
  </identification>
187
187
  </meta>
188
188
  <mainBody>
189
- <hcontainer eId="hcontainer_1" name="hcontainer">
189
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
190
190
  <content>
191
191
  <p>Subject to approval in terms of this By-Law, the erection:</p>
192
192
  </content>
193
193
  </hcontainer>
194
- <section eId="sec_1">
194
+ <section eId="att_1__sec_1">
195
195
  <num>1.</num>
196
196
  <heading>Foo</heading>
197
197
  </section>
198
- <section eId="sec_2">
198
+ <section eId="att_1__sec_2">
199
199
  <num>2.</num>
200
200
  <heading>Bar</heading>
201
201
  </section>
@@ -246,16 +246,16 @@ EOS
246
246
  </identification>
247
247
  </meta>
248
248
  <mainBody>
249
- <hcontainer eId="hcontainer_1" name="hcontainer">
249
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
250
250
  <content>
251
251
  <p>Subject to approval in terms of this By-Law, the erection:</p>
252
252
  </content>
253
253
  </hcontainer>
254
- <section eId="sec_1">
254
+ <section eId="att_1__sec_1">
255
255
  <num>1.</num>
256
256
  <heading>Foo</heading>
257
257
  </section>
258
- <section eId="sec_2">
258
+ <section eId="att_1__sec_2">
259
259
  <num>2.</num>
260
260
  <heading>Bar</heading>
261
261
  </section>
@@ -304,16 +304,16 @@ EOS
304
304
  </identification>
305
305
  </meta>
306
306
  <mainBody>
307
- <hcontainer eId="hcontainer_1" name="hcontainer">
307
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
308
308
  <content>
309
309
  <p>Subject to approval in terms of this By-Law, the erection:</p>
310
310
  </content>
311
311
  </hcontainer>
312
- <section eId="sec_1">
312
+ <section eId="att_1__sec_1">
313
313
  <num>1.</num>
314
314
  <heading>Foo</heading>
315
315
  </section>
316
- <section eId="sec_2">
316
+ <section eId="att_1__sec_2">
317
317
  <num>2.</num>
318
318
  <heading>Bar</heading>
319
319
  </section>
@@ -372,19 +372,19 @@ EOS
372
372
  </identification>
373
373
  </meta>
374
374
  <mainBody>
375
- <part eId="part_I">
375
+ <part eId="att_1__part_I">
376
376
  <num>I</num>
377
377
  <heading>Form of authentication statement</heading>
378
- <hcontainer eId="part_I__hcontainer_1" name="hcontainer">
378
+ <hcontainer eId="att_1__part_I__hcontainer_1" name="hcontainer">
379
379
  <content>
380
380
  <p>This printed impression has been carefully compared by me with the bill which was passed by Parliament and found by me to be a true copy of the bill.</p>
381
381
  </content>
382
382
  </hcontainer>
383
383
  </part>
384
- <part eId="part_II">
384
+ <part eId="att_1__part_II">
385
385
  <num>II</num>
386
386
  <heading>Form of statement of the President’s assent.</heading>
387
- <hcontainer eId="part_II__hcontainer_1" name="hcontainer">
387
+ <hcontainer eId="att_1__part_II__hcontainer_1" name="hcontainer">
388
388
  <content>
389
389
  <p>I signify my assent to the bill and a whole bunch of other stuff.</p>
390
390
  </content>
@@ -447,7 +447,7 @@ EOS
447
447
  </identification>
448
448
  </meta>
449
449
  <mainBody>
450
- <hcontainer eId="hcontainer_1" name="hcontainer">
450
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
451
451
  <content>
452
452
  <p>Subject to approval in terms of this By-Law.</p>
453
453
  <p>Schedule another</p>
@@ -499,7 +499,7 @@ EOS
499
499
  </identification>
500
500
  </meta>
501
501
  <mainBody>
502
- <hcontainer eId="hcontainer_1" name="hcontainer">
502
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
503
503
  <content>
504
504
  <p>Subject to approval in terms of this By-Law.</p>
505
505
  </content>
@@ -550,16 +550,16 @@ EOS
550
550
  </identification>
551
551
  </meta>
552
552
  <mainBody>
553
- <hcontainer eId="hcontainer_1" name="hcontainer">
553
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
554
554
  <content>
555
555
  <p>Subject to approval in terms of this By-Law, the erection:</p>
556
556
  </content>
557
557
  </hcontainer>
558
- <section eId="sec_1">
558
+ <section eId="att_1__sec_1">
559
559
  <num>1.</num>
560
560
  <heading>Foo</heading>
561
561
  </section>
562
- <section eId="sec_2">
562
+ <section eId="att_1__sec_2">
563
563
  <num>2.</num>
564
564
  <heading>Bar</heading>
565
565
  </section>
@@ -608,12 +608,12 @@ EOS
608
608
  </identification>
609
609
  </meta>
610
610
  <mainBody>
611
- <hcontainer eId="hcontainer_1" name="hcontainer">
611
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
612
612
  <content>
613
613
  <p>Subject to approval in terms of this By-Law, the erection:</p>
614
614
  </content>
615
615
  </hcontainer>
616
- <section eId="sec_1">
616
+ <section eId="att_1__sec_1">
617
617
  <num>1.</num>
618
618
  <heading>Foo</heading>
619
619
  </section>
@@ -665,16 +665,16 @@ EOS
665
665
  </identification>
666
666
  </meta>
667
667
  <mainBody>
668
- <hcontainer eId="hcontainer_1" name="hcontainer">
668
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
669
669
  <content>
670
670
  <p>Subject to approval in terms of this By-Law, the erection:</p>
671
671
  </content>
672
672
  </hcontainer>
673
- <section eId="sec_1">
673
+ <section eId="att_1__sec_1">
674
674
  <num>1.</num>
675
675
  <heading>Foo</heading>
676
676
  </section>
677
- <section eId="sec_2">
677
+ <section eId="att_1__sec_2">
678
678
  <num>2.</num>
679
679
  <heading>Bar</heading>
680
680
  </section>
@@ -729,11 +729,11 @@ EOS
729
729
  </identification>
730
730
  </meta>
731
731
  <mainBody>
732
- <section eId="sec_1">
732
+ <section eId="att_1__sec_1">
733
733
  <num>1.</num>
734
734
  <heading>Foo</heading>
735
735
  </section>
736
- <section eId="sec_2">
736
+ <section eId="att_1__sec_2">
737
737
  <num>2.</num>
738
738
  <heading>Bar</heading>
739
739
  </section>
@@ -770,7 +770,7 @@ EOS
770
770
  </identification>
771
771
  </meta>
772
772
  <mainBody>
773
- <hcontainer eId="hcontainer_1" name="hcontainer">
773
+ <hcontainer eId="att_2__hcontainer_1" name="hcontainer">
774
774
  <content>
775
775
  <p>Baz</p>
776
776
  <p>Boom</p>
@@ -826,16 +826,16 @@ EOS
826
826
  </identification>
827
827
  </meta>
828
828
  <mainBody>
829
- <hcontainer eId="hcontainer_1" name="hcontainer">
829
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
830
830
  <content>
831
831
  <p>Subject to approval in terms of this By-Law, the erection:</p>
832
832
  </content>
833
833
  </hcontainer>
834
- <section eId="sec_1">
834
+ <section eId="att_1__sec_1">
835
835
  <num>1.</num>
836
836
  <heading>Foo</heading>
837
837
  </section>
838
- <section eId="sec_2">
838
+ <section eId="att_1__sec_2">
839
839
  <num>2.</num>
840
840
  <heading>Bar</heading>
841
841
  </section>
@@ -885,16 +885,16 @@ EOS
885
885
  </identification>
886
886
  </meta>
887
887
  <mainBody>
888
- <hcontainer eId="hcontainer_1" name="hcontainer">
888
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
889
889
  <content>
890
890
  <p>Subject to approval in terms of this By-Law, the erection:</p>
891
891
  </content>
892
892
  </hcontainer>
893
- <section eId="sec_1">
893
+ <section eId="att_1__sec_1">
894
894
  <num>1.</num>
895
895
  <heading>Foo</heading>
896
896
  </section>
897
- <section eId="sec_2">
897
+ <section eId="att_1__sec_2">
898
898
  <num>2.</num>
899
899
  <heading>Bar</heading>
900
900
  </section>
@@ -942,16 +942,16 @@ EOS
942
942
  </identification>
943
943
  </meta>
944
944
  <mainBody>
945
- <hcontainer eId="hcontainer_1" name="hcontainer">
945
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
946
946
  <content>
947
947
  <p>Subject to approval in terms of this By-Law, the erection:</p>
948
948
  </content>
949
949
  </hcontainer>
950
- <section eId="sec_1">
950
+ <section eId="att_1__sec_1">
951
951
  <num>1.</num>
952
952
  <heading>Foo</heading>
953
953
  </section>
954
- <section eId="sec_2">
954
+ <section eId="att_1__sec_2">
955
955
  <num>2.</num>
956
956
  <heading>Bar</heading>
957
957
  </section>
@@ -1001,16 +1001,16 @@ EOS
1001
1001
  </identification>
1002
1002
  </meta>
1003
1003
  <mainBody>
1004
- <hcontainer eId="hcontainer_1" name="hcontainer">
1004
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
1005
1005
  <content>
1006
1006
  <p>Other than as is set out hereinbelow, no signs other than locality bound signs, temporary signs including loose portable sign, estate agents signs, newspaper headline posters and posters (the erection of which must comply with the appropriate schedules pertinent thereto) shall be erected on Municipal owned land.</p>
1007
1007
  </content>
1008
1008
  </hcontainer>
1009
- <section eId="sec_1">
1009
+ <section eId="att_1__sec_1">
1010
1010
  <num>1.</num>
1011
1011
  <heading>Foo</heading>
1012
1012
  </section>
1013
- <section eId="sec_2">
1013
+ <section eId="att_1__sec_2">
1014
1014
  <num>2.</num>
1015
1015
  <heading>Bar</heading>
1016
1016
  </section>
@@ -1060,7 +1060,7 @@ EOS
1060
1060
  </identification>
1061
1061
  </meta>
1062
1062
  <mainBody>
1063
- <hcontainer eId="hcontainer_1" name="hcontainer">
1063
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
1064
1064
  <content>
1065
1065
  <p>Subject to approval in terms of this By-Law.</p>
1066
1066
  </content>
@@ -151,10 +151,10 @@ EOS
151
151
  to_xml(node, "prefix__").should == '<table eId="prefix__table_1">
152
152
  <tr>
153
153
  <td>
154
- <p>foo<eol/>bar<eol/><eol/>baz</p>
154
+ <p>foo<br/>bar<br/><br/>baz</p>
155
155
  </td>
156
156
  <td>
157
- <p>one<eol/>two<eol/><eol/>three</p>
157
+ <p>one<br/>two<br/><br/>three</p>
158
158
  </td>
159
159
  <td>
160
160
  <p>four</p>
@@ -176,7 +176,7 @@ EOS
176
176
  to_xml(node, "prefix__").should == '<table eId="prefix__table_1">
177
177
  <tr>
178
178
  <th>
179
- <p>foo<eol/>three</p>
179
+ <p>foo<br/>three</p>
180
180
  </th>
181
181
  </tr>
182
182
  <tr>
@@ -298,10 +298,10 @@ EOS
298
298
  </identification>
299
299
  </meta>
300
300
  <mainBody>
301
- <hcontainer eId="hcontainer_1" name="hcontainer">
301
+ <hcontainer eId="att_1__hcontainer_1" name="hcontainer">
302
302
  <content>
303
303
  <p>Heres a table:</p>
304
- <table eId="hcontainer_1__table_1">
304
+ <table eId="att_1__hcontainer_1__table_1">
305
305
  <tr>
306
306
  <td>
307
307
  <p>r1c1</p>
@@ -380,7 +380,7 @@ EOS
380
380
  <p>a <ref href="/a/b">link</ref> in a table</p>
381
381
  </td>
382
382
  <td>
383
- <p><ref href="/a/b">link</ref> and<eol/><remark status="editorial">[comment]</remark></p>
383
+ <p><ref href="/a/b">link</ref> and<br/><remark status="editorial">[comment]</remark></p>
384
384
  </td>
385
385
  </tr>
386
386
  </table>'
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: 10.5.0
4
+ version: 12.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Kempe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-21 00:00:00.000000000 Z
11
+ date: 2022-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -103,9 +103,9 @@ executables:
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
+ - ".github/workflows/test.yml"
106
107
  - ".gitignore"
107
108
  - ".rspec"
108
- - ".travis.yml"
109
109
  - Gemfile
110
110
  - LICENSE.txt
111
111
  - README.md
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  - !ruby/object:Gem::Version
176
176
  version: '0'
177
177
  requirements: []
178
- rubygems_version: 3.0.3
178
+ rubygems_version: 3.1.4
179
179
  signing_key:
180
180
  specification_version: 4
181
181
  summary: A lightweight library for using Akoma Ntoso acts in Ruby.
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.7.0
4
- - 2.6.2
5
- before_install:
6
- - gem update bundler