polytexnic 1.10.8 → 1.10.9

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: a1461e5376936033caaab53e7f8b3155e15b1236f8bb1bea7a8449446d94e07e
4
- data.tar.gz: bc43814d43b48855cea681cf4e1c34615d01b0d981fcceecc23de9c5b5c71649
3
+ metadata.gz: 55cc7f5e31d22fda324ee612db4815b722708852da07058383be4137c5ebbfe2
4
+ data.tar.gz: ea3374ff55a4ba30186b7978498f5f755ab8995c0b2cfc8119985c39c4765a11
5
5
  SHA512:
6
- metadata.gz: 293509ed5960d36a8e3e7b4924fee5dcbac89577b55df9e4309d12c3abb5c34d7bf55801328bb5dd82682b4f56a7ceaa90f33e7980497287efa67a5a5e1e47c6
7
- data.tar.gz: 68cc0b9ff6f5508af52a1a6fa1626605cb96524455aa91a731aa412bd2fda98ffccbe07e2467283238101e6ed8e8e101a1d549146ce7cea8cc177dc3fe2d02c8
6
+ metadata.gz: 5ddd3da485c12d65ebd26ebcd6f776c0daf941a6690df1f7b18fc2052b3a8948152ffde9ee4a396c747fa1a566137618323508d55c9555356177f74aec3e570f
7
+ data.tar.gz: 2fd83baca16829171255f7792b8c6684c5f65a034033ddc2f535962ee6a96022f271b859dc3fa6904bf6c916725fd8994e4743ed8d5c13c89b6d4aed7cc4d773
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- polytexnic (1.10.8)
4
+ polytexnic (1.10.9)
5
5
  json (= 2.7.2)
6
6
  kramdown (= 2.4.0)
7
7
  msgpack (= 1.7.2)
@@ -69,7 +69,7 @@ GEM
69
69
  ffi (~> 1.0)
70
70
  rest-client (1.6.7)
71
71
  mime-types (>= 1.16)
72
- rexml (3.3.8)
72
+ rexml (3.4.1)
73
73
  rspec (2.99.0)
74
74
  rspec-core (~> 2.99.0)
75
75
  rspec-expectations (~> 2.99.0)
@@ -1198,7 +1198,7 @@ module Polytexnic
1198
1198
  if node['file'] && node['extension']
1199
1199
  filename = png_for_pdf(node['file'], node['extension'])
1200
1200
  alt = File.basename(node['file'])
1201
- img = %(<img src="#{filename}" alt="#{alt}" />)
1201
+ img = %(<img src="#{filename}" alt="#{alt}">)
1202
1202
  graphic = %(<span class="graphics">#{img}</span>)
1203
1203
  graphic_node = Nokogiri::HTML.fragment(graphic)
1204
1204
  if description_node = node.children.first
@@ -1384,6 +1384,11 @@ module Polytexnic
1384
1384
  string.gsub!(/<p>\s*<\/p>/m, '')
1385
1385
  end
1386
1386
 
1387
+ # Standardizes on, e.g., <img ...>, <br>, and <hr>
1388
+ def remove_trailing_slash_tags!(string)
1389
+ string.gsub!(' />', '>')
1390
+ end
1391
+
1387
1392
  # Restores quotes or verse inside figure.
1388
1393
  # This is a terrible hack.
1389
1394
  def restore_figure_quotes!(string)
@@ -1422,6 +1427,7 @@ module Polytexnic
1422
1427
  end
1423
1428
  body = doc.at_css('document').children.to_xhtml
1424
1429
  Nokogiri::HTML.fragment(body).to_xhtml.tap do |html|
1430
+ remove_trailing_slash_tags!(html)
1425
1431
  trim_empty_paragraphs!(html)
1426
1432
  restore_figure_quotes!(html)
1427
1433
  restore_literal_html!(html)
@@ -1,3 +1,3 @@
1
1
  module Polytexnic
2
- VERSION = "1.10.8"
2
+ VERSION = "1.10.9"
3
3
  end
@@ -14,7 +14,7 @@ describe 'Polytexnic::Pipeline#to_html' do
14
14
  it do
15
15
  should resemble <<-'EOS'
16
16
  foo <span><span class="graphics">
17
- <img src="foo.png" alt="foo" /></span>
17
+ <img src="foo.png" alt="foo"></span>
18
18
  </span>
19
19
  EOS
20
20
  end
@@ -30,7 +30,7 @@ describe 'Polytexnic::Pipeline#to_html' do
30
30
  it do
31
31
  should resemble <<-'EOS'
32
32
  <span class="graphics">
33
- <img src="foo.png" alt="foo" />
33
+ <img src="foo.png" alt="foo">
34
34
  </span>
35
35
  EOS
36
36
  end
@@ -126,7 +126,7 @@ describe 'Polytexnic::Pipeline#to_html' do
126
126
  should resemble <<-'EOS'
127
127
  <div id="fig-foo" data-tralics-id="uid1" data-number="1" class="figure">
128
128
  <span class="graphics">
129
- <img src="images/foo.png" alt="foo" />
129
+ <img src="images/foo.png" alt="foo">
130
130
  </span>
131
131
  <div class="caption">
132
132
  <span class="header">Figure 1</span>
@@ -161,7 +161,7 @@ describe 'Polytexnic::Pipeline#to_html' do
161
161
  </h1>
162
162
  <div id="uid1" data-tralics-id="uid1" data-number="1.1" class="figure">
163
163
  <span class="graphics">
164
- <img src="foo.png" alt="foo" />
164
+ <img src="foo.png" alt="foo">
165
165
  </span>
166
166
  <div class="caption">
167
167
  <span class="header">Figure 1.1: </span>
@@ -170,7 +170,7 @@ describe 'Polytexnic::Pipeline#to_html' do
170
170
  </div>
171
171
  <div id="uid2" data-tralics-id="uid2" data-number="1.2" class="figure">
172
172
  <span class="graphics">
173
- <img src="bar.png" alt="bar" />
173
+ <img src="bar.png" alt="bar">
174
174
  </span>
175
175
  <div class="caption">
176
176
  <span class="header">Figure 1.2: </span>
@@ -234,7 +234,7 @@ describe 'Polytexnic::Pipeline#to_html' do
234
234
  </h1>
235
235
  <div id="fig-foo" data-tralics-id="uid1" data-number="1.1" class="figure">
236
236
  <span class="graphics">
237
- <img src="foo.png" alt="foo" />
237
+ <img src="foo.png" alt="foo">
238
238
  </span>
239
239
  <div class="caption">
240
240
  <span class="header">Figure 1.1: </span>
@@ -243,7 +243,7 @@ describe 'Polytexnic::Pipeline#to_html' do
243
243
  </div>
244
244
  <div id="fig-bar" data-tralics-id="uid2" data-number="1.2" class="figure">
245
245
  <span class="graphics">
246
- <img src="bar.png" alt="bar" />
246
+ <img src="bar.png" alt="bar">
247
247
  </span>
248
248
  <div class="caption">
249
249
  <span class="header">Figure 1.2: </span>
@@ -261,7 +261,7 @@ describe 'Polytexnic::Pipeline#to_html' do
261
261
  </h1>
262
262
  <div id="fig-baz" data-tralics-id="uid3" data-number="2.1" class="figure">
263
263
  <span class="graphics">
264
- <img src="baz.png" alt="baz" />
264
+ <img src="baz.png" alt="baz">
265
265
  </span>
266
266
  <div class="caption">
267
267
  <span class="header">Figure 2.1: </span>
@@ -299,7 +299,7 @@ describe 'Polytexnic::Pipeline#to_html' do
299
299
  </h1>
300
300
  <div class="center figure" id="fig-foo" data-tralics-id="uid1" data-number="1.1">
301
301
  <span class="graphics">
302
- <img src="foo.png" alt="foo" />
302
+ <img src="foo.png" alt="foo">
303
303
  </span>
304
304
  <div class="caption">
305
305
  <span class="header">Figure 1.1: </span>
@@ -331,7 +331,7 @@ describe 'Polytexnic::Pipeline#to_html' do
331
331
  </h1>
332
332
  <div id="fig-foo" data-tralics-id="uid1" data-number="1.1" class="figure">
333
333
  <div class="graphics image">
334
- <img src="foo_bar.png" alt="foo_bar" />
334
+ <img src="foo_bar.png" alt="foo_bar">
335
335
  </div>
336
336
  <div class="caption">
337
337
  <span class="header">Figure 1.1: </span>
@@ -364,7 +364,7 @@ describe 'Polytexnic::Pipeline#to_html' do
364
364
  </h1>
365
365
  <div id="fig-foo" data-tralics-id="uid1" data-number="1.1" class="figure">
366
366
  <div class="graphics image box">
367
- <img src="foo_bar.png" alt="foo_bar" />
367
+ <img src="foo_bar.png" alt="foo_bar">
368
368
  </div>
369
369
  <div class="caption">
370
370
  <span class="header">Figure 1.1: </span>
@@ -54,7 +54,7 @@ describe 'Polytexnic::Pipeline#to_html' do
54
54
 
55
55
  describe "horizontal rule" do
56
56
  let(:polytex) { '\hrule' }
57
- it { should resemble '<hr />' }
57
+ it { should resemble '<hr>' }
58
58
  end
59
59
 
60
60
  describe "custom kode command" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polytexnic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.8
4
+ version: 1.10.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Hartl
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-10-21 00:00:00.000000000 Z
12
+ date: 2025-03-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri