slaw 0.14.0 → 0.14.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
  SHA1:
3
- metadata.gz: f461d44372208bc42f6cedb31c28b4cf8953c58d
4
- data.tar.gz: cc3e56f02927e80e96aacfb67b19b3be88c64836
3
+ metadata.gz: 9743f6466d2fd51cf2b0ed43330c8eecc7855541
4
+ data.tar.gz: 00a887ed43d64cd0788cda9ebe75be7c8a1af9aa
5
5
  SHA512:
6
- metadata.gz: 17ba42c10bd5fb2efaf5bec9e9570efb0cbd840c974d0ccf69509114358a9bc4370385d07d4ec18d685c39f96c61899790fdd101d30df69596e634875ebcac9b
7
- data.tar.gz: 8c47909bbe42bd51b6fb0ebb46893b4808340e8259aa79721ed1516f8dfd9740e7873a5ba65451245505d8890be26a61bc10aec7ce9f29af2766d1ef74314d27
6
+ metadata.gz: b2d31f8d468e1dda7b0ee056d12c83fd31cac8e0c647f3a9526dc543ae34a52a5ddb8d3b3299eba310ca5e7fe437594c4686d93570348f16dc98eceba4ad54fe
7
+ data.tar.gz: 93b9c10f53b69c939b1a90347355561ab07af581aee1f155415a937a55f8f3238a03a4e31c859fdea895aa1bd8f9023f472ec82bfe87c1b6d4c109c8c8f1d630
data/.travis.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.10
4
- - 2.2.5
5
- - 2.3.1
3
+ - 2.2.8
4
+ - 2.3.5
5
+ - 2.4.2
6
6
  before_install:
7
7
  - gem update bundler
data/README.md CHANGED
@@ -218,6 +218,10 @@ Akoma Ntoso `component` elements at the end of the XML document, with a name of
218
218
 
219
219
  ## Changelog
220
220
 
221
+ ### 0.14.1
222
+
223
+ * Support links in remarks
224
+
221
225
  ### 0.14.0
222
226
 
223
227
  * Support inline image tags, using Markdown syntax: \![alt text](image url)
data/lib/slaw/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slaw
2
- VERSION = "0.14.0"
2
+ VERSION = "0.14.1"
3
3
  end
@@ -215,7 +215,7 @@ module Slaw
215
215
  end
216
216
 
217
217
  rule remark
218
- '[[' content:(!']]' .)+ ']]'
218
+ '[[' content:(ref / (!']]' .))+ ']]'
219
219
  <Remark>
220
220
  end
221
221
 
@@ -308,7 +308,17 @@ module Slaw
308
308
 
309
309
  class Remark < Treetop::Runtime::SyntaxNode
310
310
  def to_xml(b, idprefix)
311
- b.remark('[' + content.text_value + ']', status: 'editorial')
311
+ b.remark(status: 'editorial') do |b|
312
+ b << '['
313
+ for e in content.elements
314
+ if e.respond_to? :to_xml
315
+ e.to_xml(b, idprefix)
316
+ else
317
+ b << e.text_value
318
+ end
319
+ end
320
+ b << ']'
321
+ end
312
322
  end
313
323
  end
314
324
 
@@ -274,6 +274,21 @@ EOS
274
274
  </item>
275
275
  </blockList>
276
276
  </content>
277
+ </paragraph>'
278
+ end
279
+
280
+ it 'should handle a link in an inline remark' do
281
+ node = parse :block_paragraphs, <<EOS
282
+ This statement has [[a [link in](/foo/bar) a remark]]
283
+ This statement has [[[a link in](/foo/bar) a remark]]
284
+ This statement has [[a [link in a remark](/foo/bar)]]
285
+ EOS
286
+ to_xml(node, "").should == '<paragraph id="paragraph-0">
287
+ <content>
288
+ <p>This statement has <remark status="editorial">[a <ref href="/foo/bar">link in</ref> a remark]</remark></p>
289
+ <p>This statement has <remark status="editorial">[<ref href="/foo/bar">a link in</ref> a remark]</remark></p>
290
+ <p>This statement has <remark status="editorial">[a <ref href="/foo/bar">link in a remark</ref>]</remark></p>
291
+ </content>
277
292
  </paragraph>'
278
293
  end
279
294
  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: 0.14.0
4
+ version: 0.14.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: 2017-10-09 00:00:00.000000000 Z
11
+ date: 2017-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler