lm_docstache 3.0.1 → 3.0.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8db9e1f7f1a534059ed080bfd89005372b334cc203b66cfbb45323b8116b980
|
4
|
+
data.tar.gz: 4af011e633d34a62fcc0ed24fa639e04ce88937423b8570ae4f3a8fd4ff8fe70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3c0630c4472b5d5b8f2a479a7b201411a817069221026778f86581146f4ef797dd586d2a0b299df4281394edf7878f1536ceda0d59f766a737255960a07d450
|
7
|
+
data.tar.gz: df59e4c7c9750e75f976d47ee6d8d632c795702863cdb332627497f88026efa70a2eac2b01520c615a8faf042f677e547d3fec8ae09dc470d50383e1e5ed5548
|
data/CHANGELOG.md
CHANGED
@@ -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
|
data/lib/lm_docstache/version.rb
CHANGED
Binary file
|
@@ -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.
|
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-
|
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
|