avv2word 1.1.29 → 1.1.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avv2word/document.rb +3 -4
- data/lib/avv2word/templates/default.docx +0 -0
- data/lib/avv2word/version.rb +1 -1
- data/lib/avv2word/xslt/footnote.xslt +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f21aa08f0eb889b07a6ae13cb5ed80156eb8bd3b2730b3bd99eb204a2c5b790
|
4
|
+
data.tar.gz: 172e0cde722ad248e304ca092769bef904806efb5d43a11fdc4173385ad5963b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a46e14ff10f766f006a3c3513875d6b58afe385f715b471ecedb4e5a2711514dcc468364949fdb6e51210d017e36624147f8006be361d460f137e90060922cc
|
7
|
+
data.tar.gz: '03578535709c0f1761318c6cf9c723f8bc073b8566485d7bb4b61d98df1beb18916d5a40d8c33f69a87945bef5d345022e6171b763a42df391433c945e4c679f'
|
data/lib/avv2word/document.rb
CHANGED
@@ -18,7 +18,6 @@ module Avv2word
|
|
18
18
|
mime_type, img_data = img_elm.attributes["src"].value.split(",")
|
19
19
|
# ^--data:image/jpeg;base64
|
20
20
|
ext = mime_type.match(/image\/(\w+?);base64/)[1]
|
21
|
-
ext = "jpg" if ext == "jpeg"
|
22
21
|
img_path = "tmp_imgs/image#{i+1}.#{ext}"
|
23
22
|
File.open(img_path,"wb"){|f| f.write Base64.decode64(img_data)}
|
24
23
|
img_elm.attributes["src"].value = img_path
|
@@ -49,7 +48,7 @@ module Avv2word
|
|
49
48
|
|
50
49
|
def create(content, template_name = nil, extras = false)
|
51
50
|
content = extract_images_html(content)
|
52
|
-
|
51
|
+
content = escape_footnotes(content)
|
53
52
|
template_name += extension if template_name && !template_name.end_with?(extension)
|
54
53
|
document = new(template_file(template_name))
|
55
54
|
document.replace_files(content, extras)
|
@@ -177,14 +176,14 @@ module Avv2word
|
|
177
176
|
transform_and_replace(original_source, xslt_path('relations'), Document.relations_xml_file)
|
178
177
|
source = xslt(stylesheet_name: 'cleanup').transform(original_source)
|
179
178
|
|
180
|
-
# add_footnotes(source.css("footnote").map{ |footnote| footnote.text })
|
181
|
-
|
182
179
|
transform_and_replace(source, xslt_path('numbering'), Document.numbering_xml_file)
|
183
180
|
transform_doc_xml(source, extras)
|
184
181
|
|
185
182
|
local_images(source)
|
186
183
|
local_images(footer, :footer) if @footer
|
187
184
|
local_images(header, :header) if @header
|
185
|
+
|
186
|
+
add_footnotes(source.css("footnote").map{ |footnote| footnote.text })
|
188
187
|
end
|
189
188
|
|
190
189
|
def transform_doc_xml(source, extras = false)
|
Binary file
|
data/lib/avv2word/version.rb
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"
|
17
17
|
mc:Ignorable="w14 wp14">
|
18
18
|
<xsl:template match="footnote">
|
19
|
-
|
19
|
+
<!--<xsl:number level="any" count="footnote" format="1"/>-->
|
20
20
|
<w:r>
|
21
21
|
<w:rPr>
|
22
22
|
<w:rStyle w:val="FootnoteReference"/>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avv2word
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marián Bilas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|