slaw 10.4.0 → 10.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e20546bab171b4b78f42ebd1d1a38bc246253a25423ff48067483f15d4806f71
4
- data.tar.gz: 4f5899aa5565c5a70714c2edb78774468d79620d992deef7c66991c526f63a8a
3
+ metadata.gz: aa5a1bf4a3098846a8f22ab9cff0c1a44f376407b9cc9c2f314ec69d9445c073
4
+ data.tar.gz: 918bc6711f33db010f38c80606a52c7f9ff446778230dcbeafa27d34abc5eceb
5
5
  SHA512:
6
- metadata.gz: e3d8d3dd989a852d7950deb9bc3172788f475fdfa9b6342d0d92d1ba8f60ad973ed3efc7029086e80a915672e8098e99cbbd3ad654692a103e222e3f480f53bd
7
- data.tar.gz: c605715d80d4704c619c19dd5578ed70189c302ad77d7adce70fee6b52c57b095570b041f43de24a9705fd80da924274dcb21217e2df8442b352ce082a1c4bf2
6
+ metadata.gz: 1231195c46118f5098b4b31deca137981d03dacdcdb57175c30779cd4abc0339a95d480d3d08962e8d8dfae8d6c67880c1f219867583fe3df15b531391b19086
7
+ data.tar.gz: 7bdbb9416a5c77eddab03eafef40b8aae830c2bcb71dc2cb4dc15f746be7404fd7122dbc242150e6ae90a9dca4f3a144f59013e3d36d5662de30f815aaf6ab00
data/README.md CHANGED
@@ -86,6 +86,10 @@ You can create your own grammar by creating a gem that provides these files and
86
86
 
87
87
  ## Changelog
88
88
 
89
+ ### 10.4.1 (14 April 2021)
90
+
91
+ * Handle escaping in inlines, so that forward slashes in link text are unescaped correctly, eg `[https:\/\/example.com](https://example.com)`
92
+
89
93
  ### 10.4.0 (9 April 2021)
90
94
 
91
95
  * Remove dependency on mimemagic. Guess file type based on filename instead.
@@ -37,7 +37,8 @@ module Slaw
37
37
 
38
38
  class InlineItem < Treetop::Runtime::SyntaxNode
39
39
  def to_xml(b, idprefix)
40
- b.text(text_value)
40
+ # handle escaped characters foo\/bar -> foo/bar
41
+ b.text(text_value.gsub(/\\(.)?/, '\1'))
41
42
  end
42
43
  end
43
44
 
data/lib/slaw/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slaw
2
- VERSION = "10.4.0"
2
+ VERSION = "10.4.1"
3
3
  end
@@ -118,9 +118,9 @@ EOS
118
118
  node = parse :body, <<EOS
119
119
  \\1. ignored
120
120
 
121
- \\CROSSHEADING crossheading
121
+ \\CROSSHEADING cross\\heading
122
122
 
123
- 1. Section
123
+ 1. Sec\\tion
124
124
  \\Chapter 2 ignored
125
125
  EOS
126
126
  to_xml(node).should == '<body>
@@ -325,6 +325,17 @@ EOS
325
325
  <p>This statement has <remark status="editorial">[<ref href="/foo/bar">a link in</ref> a remark]</remark></p>
326
326
  <p>This statement has <remark status="editorial">[a <ref href="/foo/bar">link in a remark</ref>]</remark></p>
327
327
  </content>
328
+ </hcontainer>'
329
+ end
330
+
331
+ it 'should handle escapes in links' do
332
+ node = parse :generic_container, <<EOS
333
+ Visit the site [https:\\/\\/example.com](https://example.com) for more.
334
+ EOS
335
+ to_xml(node, "").should == '<hcontainer eId="hcontainer_1" name="hcontainer">
336
+ <content>
337
+ <p>Visit the site <ref href="https://example.com">https://example.com</ref> for more.</p>
338
+ </content>
328
339
  </hcontainer>'
329
340
  end
330
341
  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: 10.4.0
4
+ version: 10.4.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: 2021-04-09 00:00:00.000000000 Z
11
+ date: 2021-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake