reverse_adoc 0.3.6 → 0.3.7

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: 5ada0c5000d417b1fa73962833f53144ae8ef29d4089ec49cd5aa8cfe87f0a99
4
- data.tar.gz: d56d80b96a0c52b7ad1d1c0e0133821ba9711f277388f59727fc6c904a2cad12
3
+ metadata.gz: f270330f82dbb25f80910714935e876e97d426537c4a5abd463e7bc9640e6467
4
+ data.tar.gz: 75b1f4e34156d28e64f93b8cdebd938b4286e3570154bc51f52386d3d14b69ba
5
5
  SHA512:
6
- metadata.gz: 2cde0734e47f95bb24664dade9a3a11266bf4d109b15211b45e3385d71b6cc5748d7faa238aca2861d31f01045c09975f5e516a251b7c555ad31d48199fc8a90
7
- data.tar.gz: 3f318a46c99954e5d69b12b03aaaca6e75b0238740fbdded85ae8dc2c1d147bdb1b5c2e4e9207f34406664150359a92bb6237cfe38622996cd24f89899af8323
6
+ metadata.gz: 682c02207ff5b6f9d403c3ddfbbb6733e71efcf4d0fd20b4c48aebaf48e42e241b4195753cddcffc8216870ec17338964fcc24c35aeb201fa0867e678cec3bff
7
+ data.tar.gz: 710296feb3d170223920b46184ebb7b80216db873376ff38e742cfc1b7c1935ad867e0b3bb0435d5bb5a557c46be0c3da0aeaccc1169c2363aa2eda2d95dfbde
@@ -32,17 +32,15 @@ module ReverseAdoc
32
32
  text = escape_keychars(text)
33
33
 
34
34
  text = preserve_keychars_within_backticks(text)
35
- text = preserve_tags(text)
36
-
37
- text
35
+ escape_links(text)
38
36
  end
39
37
 
40
38
  def preserve_nbsp(text)
41
39
  text.gsub(/\u00A0/, " ")
42
40
  end
43
41
 
44
- def preserve_tags(text)
45
- text.gsub(/[<>]/, '>' => '\>', '<' => '\<')
42
+ def escape_links(text)
43
+ text.gsub(/<<([^>]*)>>/, "\\<<\\1>>")
46
44
  end
47
45
 
48
46
  def remove_border_newlines(text)
@@ -1,3 +1,3 @@
1
1
  module ReverseAdoc
2
- VERSION = "0.3.6".freeze
2
+ VERSION = "0.3.7".freeze
3
3
  end
data/reverse_adoc.gemspec CHANGED
@@ -19,12 +19,12 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- exe/*`.split("\n").map { |f| File.basename(f) }
20
20
  s.bindir = "exe"
21
21
  s.require_paths = ["lib"]
22
- s.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
22
+ s.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
23
23
 
24
24
  # specify any dependencies here; for example:
25
25
  s.add_dependency "marcel", "~> 1.0.0"
26
26
  s.add_dependency "mathml2asciimath"
27
- s.add_dependency "nokogiri", "~> 1.12"
27
+ s.add_dependency "nokogiri", "~> 1.13"
28
28
  s.add_development_dependency "codeclimate-test-reporter"
29
29
  s.add_development_dependency "rake"
30
30
  s.add_development_dependency "redcarpet"
@@ -28,10 +28,16 @@ describe ReverseAdoc::Converters::Text do
28
28
  expect(result).to eq "foo&nbsp;bar &nbsp;"
29
29
  end
30
30
 
31
- it 'keeps escaped HTML-ish characters' do
31
+ it "keeps HTML characters" do
32
32
  input = node_for("<p>&lt;foo&gt;</p>")
33
33
  result = converter.convert(input)
34
- expect(result).to eq '\<foo\>'
34
+ expect(result).to eq "<foo>"
35
+ end
36
+
37
+ it "escapes Link like characters in text" do
38
+ input = node_for("<p>&lt;&lt;foo&gt;&gt;</p>")
39
+ result = converter.convert(input)
40
+ expect(result).to eq '\<<foo>>'
35
41
  end
36
42
 
37
43
  context 'within backticks' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reverse_adoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-13 00:00:00.000000000 Z
11
+ date: 2023-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: marcel
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.12'
47
+ version: '1.13'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.12'
54
+ version: '1.13'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: codeclimate-test-reporter
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -275,14 +275,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
275
275
  requirements:
276
276
  - - ">="
277
277
  - !ruby/object:Gem::Version
278
- version: 2.5.0
278
+ version: 2.7.0
279
279
  required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  requirements:
281
281
  - - ">="
282
282
  - !ruby/object:Gem::Version
283
283
  version: '0'
284
284
  requirements: []
285
- rubygems_version: 3.1.6
285
+ rubygems_version: 3.3.26
286
286
  signing_key:
287
287
  specification_version: 4
288
288
  summary: Generate AsciiDoc from HTML and Microsoft Word via CLI or library.