htmltoooxml 0.3.9 → 0.4.3

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: 865b68c33bb37b35587787fa328cdba39a069f97a970b2082bb8fb7a1d9d84f6
4
- data.tar.gz: a7f9f443518b9e3e0d41f6e0f629c17b49c10fabdc73c6ebf22387cc5d5bc901
3
+ metadata.gz: 8d12ae5bf06909c848928c71822e240d56058de0dba36703665087102218f4d6
4
+ data.tar.gz: 78477ed4db7f153f7be6b6ca39870b41ba0b1c507a5c1d974da64f8471cb02af
5
5
  SHA512:
6
- metadata.gz: 4ff0fa109f00648674f14c2a99085b67e126b4119aa679e3a57449e1299702a4213fec517010108e1546b596c8b91ec7f7601db82ffa30931a30242119492596
7
- data.tar.gz: 9d82467c0ba9c523060076256a2fe9e13661b5b0bb952db294b7ecd9aeeafe5c502928bfd4e6c1b11522c971f732b05d8be6de2be239b6a65f65993f41a6b3d8
6
+ metadata.gz: 480484bdfc7fb53a444527c6f0f7cfc6854d6fe081bdd0031656a5b65728120071b0f7702d4e89717662870332b0895b7e2cb07b435ccc68f7e78ebaec72a66d
7
+ data.tar.gz: 5382528f32867ecf04da597d8dcb43d2611a67464a7395ee3b1cce4c68df57a6e3e583dd9f41d21b4400a10f609cc2e9d66e10d97717089a650f564537f4ccfd
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.6.2
@@ -1,3 +1,3 @@
1
1
  module Htmltoooxml
2
- VERSION = "0.3.9"
2
+ VERSION = "0.4.3"
3
3
  end
@@ -51,25 +51,19 @@
51
51
  </a:p>
52
52
  </xsl:template>
53
53
 
54
-
55
54
  <xsl:template match="br[not(ancestor::p) and not(ancestor::div) and not(ancestor::td|ancestor::li) or
56
55
  (preceding-sibling::div or following-sibling::div or preceding-sibling::p or following-sibling::p)]">
57
- <a:p>
58
- <a:r></a:r>
59
- </a:p>
56
+ <a:p><a:endParaRPr/></a:p>
60
57
  </xsl:template>
61
58
 
62
59
  <xsl:template match="br[(ancestor::li or ancestor::td) and
63
60
  (preceding-sibling::div or following-sibling::div or preceding-sibling::p or following-sibling::p)]">
64
- <a:r>
65
- <a:br />
66
- </a:r>
61
+ <xsl:apply-templates />
62
+ <a:p><a:endParaRPr/></a:p>
67
63
  </xsl:template>
68
64
 
69
65
  <xsl:template match="br">
70
- <a:r>
71
- <a:br />
72
- </a:r>
66
+ <a:p><a:endParaRPr/></a:p>
73
67
  </xsl:template>
74
68
 
75
69
  <xsl:template match="pre">
@@ -81,6 +75,14 @@
81
75
  <xsl:template match="div[not(ancestor::li) and not(ancestor::td) and not(ancestor::th) and not(ancestor::p) and not(descendant::div) and not(descendant::p) and not(descendant::h1) and not(descendant::h2) and not(descendant::h3) and not(descendant::h4) and not(descendant::h5) and not(descendant::h6) and not(descendant::table) and not(descendant::li) and not (descendant::pre)]">
82
76
  <xsl:comment>Divs should create a p if nothing above them has and nothing below them will</xsl:comment>
83
77
  <a:p>
78
+ <a:pPr>
79
+ <a:spcBef>
80
+ <a:spcPts val="200"/>
81
+ </a:spcBef>
82
+ <a:spcAft>
83
+ <a:spcPts val="600"/>
84
+ </a:spcAft>
85
+ </a:pPr>
84
86
  <xsl:call-template name="text-alignment" />
85
87
  <xsl:apply-templates />
86
88
  </a:p>
@@ -94,6 +96,14 @@
94
96
  <xsl:template match="body/h1|body/h2|body/h3|body/h4|body/h5|body/h6|h1|h2|h3|h4|h5|h6">
95
97
  <xsl:variable name="length" select="string-length(name(.))"/>
96
98
  <a:p>
99
+ <a:pPr>
100
+ <a:spcBef>
101
+ <a:spcPts val="200"/>
102
+ </a:spcBef>
103
+ <a:spcAft>
104
+ <a:spcPts val="600"/>
105
+ </a:spcAft>
106
+ </a:pPr>
97
107
  <a:r>
98
108
  <a:rPr b="1" dirty="0"/>
99
109
  <a:t><xsl:value-of select="."/></a:t>
@@ -103,6 +113,14 @@
103
113
 
104
114
  <xsl:template match="p[not(ancestor::li)]">
105
115
  <a:p>
116
+ <a:pPr>
117
+ <a:spcBef>
118
+ <a:spcPts val="200"/>
119
+ </a:spcBef>
120
+ <a:spcAft>
121
+ <a:spcPts val="600"/>
122
+ </a:spcAft>
123
+ </a:pPr>
106
124
  <xsl:call-template name="text-alignment" />
107
125
  <xsl:apply-templates />
108
126
  </a:p>
@@ -149,10 +167,11 @@
149
167
  </xsl:when>
150
168
  <xsl:otherwise>
151
169
  <a:p>
152
- <a:r>
153
- <a:pPr marL="457200" indent="-457200"><a:buFont typeface="Arial" panose="020B0604020202020204" pitchFamily="34" charset="0"/>
170
+ <a:pPr marL="457200" indent="-457200">
171
+ <a:buFont typeface="Arial" panose="020B0604020202020204" pitchFamily="34" charset="0"/>
154
172
  <a:buChar char="•"/>
155
- </a:pPr>
173
+ </a:pPr>
174
+ <a:r>
156
175
  <a:rPr dirty="0"/>
157
176
  <a:t><xsl:value-of select="."/></a:t>
158
177
  </a:r>
@@ -258,9 +277,7 @@
258
277
 
259
278
  <xsl:template match="div[contains(concat(' ', @class, ' '), ' -page-break ')]">
260
279
  <a:p>
261
- <a:r>
262
- <a:br a:type="page" />
263
- </a:r>
280
+ <a:endParaRPr/>
264
281
  </a:p>
265
282
  <xsl:apply-templates />
266
283
  </xsl:template>
@@ -270,23 +287,19 @@
270
287
  <xsl:template match="text()">
271
288
  <xsl:if test="string-length(.) > 0">
272
289
  <a:r>
273
- <xsl:if test="ancestor::i">
274
- <a:rPr dirty="0" i="1"/>
275
- </xsl:if>
276
- <xsl:if test="ancestor::b">
277
- <a:rPr dirty="0" b="1"/>
278
- </xsl:if>
279
- <xsl:if test="ancestor::u">
280
- <a:rPr dirty="0"/>
281
- </xsl:if>
282
- <xsl:if test="ancestor::s">
283
- <a:rPr dirty="0"/>
284
- </xsl:if>
285
- <xsl:if test="ancestor::sub">
286
- <a:rPr dirty="0"/>
287
- </xsl:if>
288
- <xsl:if test="ancestor::sup">
289
- <a:rPr dirty="0"/>
290
+ <xsl:if test="ancestor::i | ancestor::b | ancestor::u | ancestor::s | ancestor::sub | ancestor::sup">
291
+ <xsl:element name="a:rPr">
292
+ <xsl:attribute name="dirty">0</xsl:attribute>
293
+ <xsl:if test="ancestor::i">
294
+ <xsl:attribute name="i">1</xsl:attribute>
295
+ </xsl:if>
296
+ <xsl:if test="ancestor::b">
297
+ <xsl:attribute name="b">1</xsl:attribute>
298
+ </xsl:if>
299
+ <xsl:if test="ancestor::u">
300
+ <xsl:attribute name="u">sng</xsl:attribute>
301
+ </xsl:if>
302
+ </xsl:element>
290
303
  </xsl:if>
291
304
  <a:t><xsl:value-of select="."/></a:t>
292
305
  </a:r>
@@ -30,6 +30,9 @@
30
30
  <xsl:template match="p">
31
31
  <a:p>
32
32
  <a:pPr marL="0" indent="0">
33
+ <a:spcBef>
34
+ <a:spcPts val="200"/>
35
+ </a:spcBef>
33
36
  <a:spcAft>
34
37
  <a:spcPts val="600"/>
35
38
  </a:spcAft>
@@ -304,4 +307,4 @@
304
307
  </a:pPr>
305
308
  </xsl:if>
306
309
  </xsl:template>
307
- </xsl:stylesheet>
310
+ </xsl:stylesheet>
@@ -1,7 +1,7 @@
1
1
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
2
2
  <xsl:output encoding="utf-8" omit-xml-declaration="yes" indent="yes" />
3
3
 
4
- <xsl:strip-space elements="*"/>
4
+ <xsl:preserve-space elements="p div span b i u s sub sup a"/>
5
5
 
6
6
  <xsl:template match="node()|@*">
7
7
  <xsl:copy>
@@ -37,4 +37,4 @@
37
37
  </xsl:copy>
38
38
  <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()]"/>
39
39
  </xsl:template>
40
- </xsl:stylesheet>
40
+ </xsl:stylesheet>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htmltoooxml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Boynton
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-20 00:00:00.000000000 Z
11
+ date: 2025-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -88,6 +88,7 @@ extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - ".gitignore"
91
+ - ".ruby-version"
91
92
  - CODE_OF_CONDUCT.md
92
93
  - Gemfile
93
94
  - LICENSE.txt
@@ -114,7 +115,7 @@ homepage: https://github.com/stylefoundry
114
115
  licenses:
115
116
  - MIT
116
117
  metadata: {}
117
- post_install_message:
118
+ post_install_message:
118
119
  rdoc_options: []
119
120
  require_paths:
120
121
  - lib
@@ -130,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
131
  version: '0'
131
132
  requirements: []
132
133
  rubygems_version: 3.0.3
133
- signing_key:
134
+ signing_key:
134
135
  specification_version: 4
135
136
  summary: Parse HTML and convert to open office xml for powerpoint
136
137
  test_files: []