avv2word 1.1.34 → 1.1.39

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: 2ac8c2201742521a8490bbfc7d4dd37c48b266a55a0433523eb77673c2a4f7e1
4
- data.tar.gz: f07a18f6d7e78f77ad2514f83bed08289d9e556ccbbc13741fd0583fdc0e3d6b
3
+ metadata.gz: 59f44cae1d61b429b6ceb5f036cb04e70aaaae15150b022613bc96c364ea780b
4
+ data.tar.gz: a4c70ccaa942030d0956237f742dce592e9ac22be38fb77bcb046be3f2e6e592
5
5
  SHA512:
6
- metadata.gz: 12578f80fa3c9bbd6e406a2f81ce125c0af34042d898aad7888e2f50233d3341c3604ed8103f92efdf4361029d425e45c67e74c906782a84022f8e37cf910e54
7
- data.tar.gz: 23e13191db0523d71321d8507136e1e499bb39e49da54586f7596311043a9141bffaaffc1c1d192ddf1e71613f404fb0e125429f8d3e45fa3c6e1270c945f645
6
+ metadata.gz: e7aea5342d342836f05899292734da481f06271aca81a032907033d2fab6e8d0a5e458bddc5d429dc11f76a46a7cbe237e02c98d7706a92bf71f175d9686f4b5
7
+ data.tar.gz: b562e13f6c6a6faaf68466df39d0ffe791c87156bc51699d399d60e6fcfd9370e5c8554856fb43de8136b85a4a6f2b7d71243d165a820722d6bd4278600ba807
@@ -100,6 +100,10 @@ module Avv2word
100
100
  def footnotes_xml_file
101
101
  'word/footnotes.xml'
102
102
  end
103
+
104
+ def styles_xml_file
105
+ 'word/styles.xml'
106
+ end
103
107
  end
104
108
 
105
109
  def initialize(template_path)
@@ -269,8 +273,8 @@ module Avv2word
269
273
  styles = Nokogiri::XML.parse(zipfile.read("word/styles.xml"))
270
274
  end
271
275
  end
272
- [ '<w:style w:type="paragraph" w:styleId="FootnoteText"><w:name w:val="footnote text"/><w:basedOn w:val="Normal"/><w:link w:val="FootnoteTextChar"/><w:uiPriority w:val="99"/><w:semiHidden/><w:unhideWhenUsed/><w:rsid w:val="008D12FB"/></w:style>',
273
- '<w:style w:type="character" w:customStyle="1" w:styleId="FootnoteTextChar"><w:name w:val="Footnote Text Char"/><w:basedOn w:val="DefaultParagraphFont"/><w:link w:val="FootnoteText"/><w:uiPriority w:val="99"/><w:semiHidden/><w:rsid w:val="008D12FB"/><w:rPr><w:sz w:val="14"/></w:rPr></w:style>',
276
+ [ '<w:style w:type="paragraph" w:styleId="FootnoteText"><w:name w:val="footnote text"/><w:basedOn w:val="Normal"/><w:link w:val="FootnoteTextChar"/><w:uiPriority w:val="99"/><w:semiHidden/><w:unhideWhenUsed/><w:rsid w:val="008D12FB"/><w:rsid w:val="008D12FB"/><w:rPr><w:sz w:val="16"/></w:rPr></w:style>',
277
+ '<w:style w:type="character" w:customStyle="1" w:styleId="FootnoteTextChar"><w:name w:val="Footnote Text Char"/><w:basedOn w:val="DefaultParagraphFont"/><w:link w:val="FootnoteText"/><w:uiPriority w:val="99"/><w:semiHidden/></w:style>',
274
278
  '<w:style w:type="character" w:styleId="FootnoteReference"><w:name w:val="footnote reference"/><w:basedOn w:val="DefaultParagraphFont"/><w:uiPriority w:val="99"/><w:semiHidden/><w:unhideWhenUsed/><w:rsid w:val="008D12FB"/><w:rPr><w:vertAlign w:val="superscript"/></w:rPr></w:style>'
275
279
  ].each do |new_style|
276
280
  styles.children.first << Nokogiri::XML.parse(new_style).child
@@ -1,3 +1,3 @@
1
1
  module Avv2word
2
- VERSION = '1.1.34'
2
+ VERSION = '1.1.39'
3
3
  end
@@ -208,12 +208,16 @@
208
208
  <xsl:variable name="ilvl" select="@level"></xsl:variable>
209
209
  <xsl:variable name="toc-ref" select="@toc-ref" />
210
210
  <xsl:variable name="cross-ref" select="@cross-ref" />
211
+ <xsl:variable name="docx-style" select="@data-docx-style" />
211
212
  <w:p>
212
213
  <w:pPr>
213
214
  <xsl:choose>
214
215
  <xsl:when test="string-length(normalize-space($toc-ref)) > 0">
215
216
  <w:pStyle w:val="Heading{$ilvl+1}"/>
216
217
  </xsl:when>
218
+ <xsl:when test="string-length($docx-style) > 0">
219
+ <w:pStyle w:val="{$docx-style}"/>
220
+ </xsl:when>
217
221
  <xsl:otherwise>
218
222
  <w:pStyle w:val="ListParagraph"/>
219
223
  </xsl:otherwise>
@@ -280,7 +284,7 @@
280
284
  </w:p>
281
285
  </xsl:template>
282
286
 
283
- <xsl:template match="text()[not(parent::li) and not(parent::td) and not(parent::pre) and (preceding-sibling::h1 or preceding-sibling::h2 or preceding-sibling::h3 or preceding-sibling::h4 or preceding-sibling::h5 or preceding-sibling::h6 or preceding-sibling::table or preceding-sibling::p or preceding-sibling::ol or preceding-sibling::ul or preceding-sibling::div or following-sibling::h1 or following-sibling::h2 or following-sibling::h3 or following-sibling::h4 or following-sibling::h5 or following-sibling::h6 or following-sibling::table or following-sibling::p or following-sibling::ol or following-sibling::ul or following-sibling::div)]">
287
+ <xsl:template match="text()[(parent::li) and not(parent::td) and not(parent::pre) and (preceding-sibling::h1 or preceding-sibling::h2 or preceding-sibling::h3 or preceding-sibling::h4 or preceding-sibling::h5 or preceding-sibling::h6 or preceding-sibling::table or preceding-sibling::p or preceding-sibling::ol or preceding-sibling::ul or preceding-sibling::div or following-sibling::h1 or following-sibling::h2 or following-sibling::h3 or following-sibling::h4 or following-sibling::h5 or following-sibling::h6 or following-sibling::table or following-sibling::p or following-sibling::ol or following-sibling::ul or following-sibling::div)]">
284
288
  <xsl:comment>
285
289
  In the following situation:
286
290
 
@@ -413,6 +417,7 @@
413
417
  <xsl:template name="text-alignment">
414
418
  <xsl:param name="class" select="@class" />
415
419
  <xsl:param name="style" select="@style" />
420
+ <xsl:param name="docx-style" select="@data-docx-style" />
416
421
  <xsl:param name="line-height" select="@line-height" />
417
422
  <xsl:param name="margin-bottom" select="@margin-bottom" />
418
423
  <xsl:param name="margin-top" select="@margin-top" />
@@ -506,6 +511,9 @@
506
511
  <w:jc w:val="{$alignment}"/>
507
512
  </xsl:when>
508
513
  </xsl:choose>
514
+ <xsl:if test="string-length($docx-style) > 0">
515
+ <w:pStyle w:val="{$docx-style}"/>
516
+ </xsl:if>
509
517
  </w:pPr>
510
518
  </xsl:template>
511
519
 
@@ -571,7 +579,7 @@
571
579
  <xsl:number level="any" count="insert" format="1"/>
572
580
  <w:ins w:id="{format-number(count(preceding::insert)+1,'0')}">
573
581
  <w:r>
574
- <w:t><xsl:value-of select="."/></w:t>
582
+ <w:t xml:space="preserve"><xsl:value-of select="."/></w:t>
575
583
  </w:r>
576
584
  </w:ins>
577
585
  </xsl:template>
@@ -580,7 +588,7 @@
580
588
  <xsl:number level="any" count="delete" format="1"/>
581
589
  <w:del w:id="{format-number(count(preceding::delete)+1,'0')}">
582
590
  <w:r>
583
- <w:delText><xsl:value-of select="."/></w:delText>
591
+ <w:delText xml:space="preserve"><xsl:value-of select="."/></w:delText>
584
592
  </w:r>
585
593
  </w:del>
586
594
  </xsl:template>
@@ -18,7 +18,7 @@
18
18
  <xsl:attribute name="style"><xsl:value-of select="../@style"/></xsl:attribute>
19
19
  <xsl:call-template name="inlineElement"/>
20
20
  </div>
21
- <xsl:apply-templates select="following-sibling::node()[not((self::a|self::b|self::i|self::s|self::span|self::sub|self::sup|self::u|self::delete|self::insert|self::text())[parent::div|parent::li|parent::td])][1]"/>
21
+ <xsl:apply-templates select="following-sibling::node()[not((self::a|self::b|self::i|self::s|self::span|self::sub|self::sup|self::u|self::delete|self::insert|self::cross-ref|self::text())[parent::div|parent::li|parent::td])][1]"/>
22
22
  </xsl:template>
23
23
 
24
24
  <!-- get following inline elements... -->
@@ -36,6 +36,6 @@
36
36
  <xsl:copy>
37
37
  <xsl:apply-templates select="@*|node()[1]"/>
38
38
  </xsl:copy>
39
- <xsl:apply-templates select="following-sibling::node()[1][self::a|self::b|self::i|self::s|self::span|self::sub|self::sup|self::u|self::text()|self::insert|self::delete]"/>
39
+ <xsl:apply-templates select="following-sibling::node()[1][self::a|self::b|self::i|self::s|self::span|self::sub|self::sup|self::u|self::text()|self::insert|self::delete|self::cross-ref]"/>
40
40
  </xsl:template>
41
41
  </xsl:stylesheet>
@@ -32,14 +32,15 @@
32
32
  <xsl:choose>
33
33
  <xsl:when test="string-length(normalize-space($ind_left)) > 0">
34
34
  <w:tblW w:w="{9360 - $ind_left}" w:type="dxa"/>
35
+ <!--table indent left-->
36
+ <w:tblInd w:w="{115 + $ind_left}" w:type="dxa"/>
35
37
  </xsl:when>
36
38
  <xsl:otherwise>
37
39
  <w:tblW w:w="9360" w:type="dxa"/>
40
+ <w:tblInd w:w="115" w:type="dxa"/>
38
41
  </xsl:otherwise>
39
42
  </xsl:choose>
40
43
 
41
- <!--table indent left-->
42
- <w:tblInd w:w="{$ind_left}" w:type="dxa"/>
43
44
  <!--table indent left, top; works in word without margin(?), not in libre-->
44
45
  <!--<w:tblpPr w:leftFromText="180" w:rightFromText="180" w:vertAnchor="text" w:horzAnchor="page" w:tblpX="{$ind_left}" w:tblpY="{$ind_top}"/>-->
45
46
 
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.34
4
+ version: 1.1.39
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: 2020-05-06 00:00:00.000000000 Z
11
+ date: 2020-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack