htmltoooxml 0.4.0 → 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: a7d9fb91ab66c01d35e2098755d1c92dd4514527aa9df071581595abb9577290
4
- data.tar.gz: f889a3c88a6364ae5bae4090f9b35f517554cc74f2f19b8bebc390273c0cefaa
3
+ metadata.gz: 8d12ae5bf06909c848928c71822e240d56058de0dba36703665087102218f4d6
4
+ data.tar.gz: 78477ed4db7f153f7be6b6ca39870b41ba0b1c507a5c1d974da64f8471cb02af
5
5
  SHA512:
6
- metadata.gz: c5cfd53a6d76249e77bb7c7c508447b1c248cd14aa145e7dd9d17f28e3ca66c467d5ac7693c5d267c84d3f0daa6a92cde5046ee7d2b5c04aaa8f02546c5f76f7
7
- data.tar.gz: 32d8807a3b1cf160397346c0e5244c5b690875b5daba5125ee2003e47da39bda4f1c27eeb7f54452f3cd41d8cad460379074dd5b74b933933332a13064ed3235
6
+ metadata.gz: 480484bdfc7fb53a444527c6f0f7cfc6854d6fe081bdd0031656a5b65728120071b0f7702d4e89717662870332b0895b7e2cb07b435ccc68f7e78ebaec72a66d
7
+ data.tar.gz: 5382528f32867ecf04da597d8dcb43d2611a67464a7395ee3b1cce4c68df57a6e3e583dd9f41d21b4400a10f609cc2e9d66e10d97717089a650f564537f4ccfd
@@ -1,3 +1,3 @@
1
1
  module Htmltoooxml
2
- VERSION = "0.4.0"
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>
@@ -259,9 +277,7 @@
259
277
 
260
278
  <xsl:template match="div[contains(concat(' ', @class, ' '), ' -page-break ')]">
261
279
  <a:p>
262
- <a:r>
263
- <a:br a:type="page" />
264
- </a:r>
280
+ <a:endParaRPr/>
265
281
  </a:p>
266
282
  <xsl:apply-templates />
267
283
  </xsl:template>
@@ -271,23 +287,19 @@
271
287
  <xsl:template match="text()">
272
288
  <xsl:if test="string-length(.) > 0">
273
289
  <a:r>
274
- <xsl:if test="ancestor::i">
275
- <a:rPr dirty="0" i="1"/>
276
- </xsl:if>
277
- <xsl:if test="ancestor::b">
278
- <a:rPr dirty="0" b="1"/>
279
- </xsl:if>
280
- <xsl:if test="ancestor::u">
281
- <a:rPr dirty="0"/>
282
- </xsl:if>
283
- <xsl:if test="ancestor::s">
284
- <a:rPr dirty="0"/>
285
- </xsl:if>
286
- <xsl:if test="ancestor::sub">
287
- <a:rPr dirty="0"/>
288
- </xsl:if>
289
- <xsl:if test="ancestor::sup">
290
- <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>
291
303
  </xsl:if>
292
304
  <a:t><xsl:value-of select="."/></a:t>
293
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.4.0
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
@@ -115,7 +115,7 @@ homepage: https://github.com/stylefoundry
115
115
  licenses:
116
116
  - MIT
117
117
  metadata: {}
118
- post_install_message:
118
+ post_install_message:
119
119
  rdoc_options: []
120
120
  require_paths:
121
121
  - lib
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubygems_version: 3.0.3
134
- signing_key:
134
+ signing_key:
135
135
  specification_version: 4
136
136
  summary: Parse HTML and convert to open office xml for powerpoint
137
137
  test_files: []