lm_docstache 3.0.1 → 3.0.2

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: b43bd6c92fe86cdde66926647f6b98a90c68d9cdf2418d7c3db07494d1872bc1
4
- data.tar.gz: 52b819e713189acc459c8290614a46791e7dbc6e0049ba32e2fb7b204f44bd29
3
+ metadata.gz: e8db9e1f7f1a534059ed080bfd89005372b334cc203b66cfbb45323b8116b980
4
+ data.tar.gz: 4af011e633d34a62fcc0ed24fa639e04ce88937423b8570ae4f3a8fd4ff8fe70
5
5
  SHA512:
6
- metadata.gz: f96c3e1d1f76400286c984309db190326440aaf6c4bf93aaec2896297fa1fad4a1e44fb0c09f0e4c2aa0c8a912876e5aabdf5eadd7edd85a7345d2d819860377
7
- data.tar.gz: fee26975013fe5e92699a5da1ef317c9bf989269f5a369e3e11ef47aa82a8047d1648563ece41d4fed6186c58a7fe7319ce9ba9b1cfab732fbc7dd77e464c981
6
+ metadata.gz: e3c0630c4472b5d5b8f2a479a7b201411a817069221026778f86581146f4ef797dd586d2a0b299df4281394edf7878f1536ceda0d59f766a737255960a07d450
7
+ data.tar.gz: df59e4c7c9750e75f976d47ee6d8d632c795702863cdb332627497f88026efa70a2eac2b01520c615a8faf042f677e547d3fec8ae09dc470d50383e1e5ed5548
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.2
4
+
5
+ ### Bugfix
6
+
7
+ * Fix replacing tags related to hidden custom tags regexp formats. E.g. tab characters.
8
+
9
+
3
10
  ## 3.0.1
4
11
 
5
12
  ### Bugfix
@@ -28,17 +28,17 @@ module LMDocstache
28
28
  next unless paragraph.text =~ full_pattern
29
29
  run_nodes = paragraph.css('w|r')
30
30
  while run_node = run_nodes.shift
31
- next if run_node.text.to_s.strip.size == 0
32
31
  next unless run_node.at_css('w|t')
32
+ next unless run_node.text =~ full_pattern
33
33
  remainder_run_node = run_node.clone
34
34
  run_node.unlink
35
35
  tag_contents = split_tag_content(remainder_run_node.text, full_pattern)
36
36
  tag_contents[:content_list].each_with_index do |content, idx|
37
37
  replace_content(remainder_run_node, content)
38
- run_node_with_match = remainder_run_node.dup
39
38
  matched_tag = tag_contents[:matched_tags][idx]
40
39
  nodes_list = [remainder_run_node]
41
40
  if matched_tag
41
+ run_node_with_match = remainder_run_node.dup
42
42
  replace_style(run_node_with_match)
43
43
  matched_content = matched_tag
44
44
  if value
@@ -1,3 +1,3 @@
1
1
  module LMDocstache
2
- VERSION = "3.0.1"
2
+ VERSION = "3.0.2"
3
3
  end
@@ -85,5 +85,14 @@ describe LMDocstache::HideCustomTags do
85
85
  expect(total_replacement).to eq(2)
86
86
  end
87
87
  end
88
+
89
+ context 'giving a document with tabs spacing in the middle of replacement tags' do
90
+ let(:input_file) { "#{base_path}/sample-signature-with-tabs-spacing.docx" }
91
+ it 'expect to not replace tabs' do
92
+ hide_custom_tags.hide_custom_tags!
93
+ d = hide_custom_tags.document
94
+ expect(d.css('w|p w|tab').size).to eq(11)
95
+ end
96
+ end
88
97
  end
89
98
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lm_docstache
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roey Chasman
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2021-03-26 00:00:00.000000000 Z
15
+ date: 2021-04-08 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: nokogiri
@@ -123,6 +123,7 @@ files:
123
123
  - spec/example_input/blank.docx
124
124
  - spec/example_input/docx-no-rpr.docx
125
125
  - spec/example_input/sample-signature-blue.docx
126
+ - spec/example_input/sample-signature-with-tabs-spacing.docx
126
127
  - spec/example_input/sample-signature.docx
127
128
  - spec/hide_custom_tags_spec.rb
128
129
  - spec/integration_spec.rb
@@ -157,6 +158,7 @@ test_files:
157
158
  - spec/example_input/blank.docx
158
159
  - spec/example_input/docx-no-rpr.docx
159
160
  - spec/example_input/sample-signature-blue.docx
161
+ - spec/example_input/sample-signature-with-tabs-spacing.docx
160
162
  - spec/example_input/sample-signature.docx
161
163
  - spec/hide_custom_tags_spec.rb
162
164
  - spec/integration_spec.rb