polytexnic 1.8.2 → 1.9.1

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: ff82492919e49e1998de1a1daf06d8d35d58091b36f00ec0ba9131233655cd2f
4
- data.tar.gz: d63bced974ebbb926b24fac2640f081aea3cc8300e9a8a428397dc772d9b5acf
3
+ metadata.gz: 1b5dc960f818c0dd1342080a1d886582ecdd67a8ccf7688cae86e79c18309278
4
+ data.tar.gz: 24f2ce7be9a136c54aacab4a78d47ff17598182c8095038c95c6a215ab0c45f4
5
5
  SHA512:
6
- metadata.gz: 248c5a703557b271839e4b933b1412bff785bb0924b30c8a9c557582a9ab2a2c2126c2454177b064fc2e32a1c407fe443c15bfae49cf5add5c7ef6438d782356
7
- data.tar.gz: 66c68711d14ad7bc00b6b319464f2468807df6f36a8bd30a70e440e887bc0ef406511c336e28987c2ffbf8cd50753d76b02d1daa543a6ea3f40a29f24e4720db
6
+ metadata.gz: e972fa4b84925ef11ac37e246184811bd5630ac3b6036f9609a67dd5816be0e04c53ea15db9e440571f596ad341e88316eeaf488137c61da8395503f0ea0fba1
7
+ data.tar.gz: 1140d6a5159c5c166a8eb3c7db75882a93782b976721e1bac76a7c29439a702a76c1cfcbdc33166090c53adcb2b013663e55a63fb5849147621516a697149c09
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- polytexnic (1.8.2)
4
+ polytexnic (1.9.1)
5
5
  json (= 2.3.1)
6
6
  kramdown (= 2.4.0)
7
7
  msgpack (= 1.2.10)
@@ -67,7 +67,7 @@ GEM
67
67
  ffi (~> 1.0)
68
68
  rest-client (1.6.7)
69
69
  mime-types (>= 1.16)
70
- rexml (3.2.5)
70
+ rexml (3.2.6)
71
71
  rspec (2.99.0)
72
72
  rspec-core (~> 2.99.0)
73
73
  rspec-expectations (~> 2.99.0)
@@ -419,8 +419,10 @@ module Polytexnic
419
419
  node.add_next_sibling(space)
420
420
  end
421
421
  # Remove spurious intersentence space from mid-sentence notes.
422
+ closing_paren = after && after.content[0] == ")"
422
423
  next_sibling = node.next_sibling
423
- if !end_of_sentence && intersentence_space?(next_sibling)
424
+ if ((!end_of_sentence || closing_paren) &&
425
+ intersentence_space?(next_sibling))
424
426
  next_sibling.remove
425
427
  end
426
428
  end
@@ -541,9 +543,9 @@ module Polytexnic
541
543
 
542
544
  # Returns the node for a list item (li).
543
545
  def item(doc)
544
- doc.xpath('//item/p[@noindent="true"]').each do |node|
545
- node.replace(node.inner_html)
546
- end
546
+ # doc.xpath('//item/p[@noindent="true"]').each do |node|
547
+ # node.replace(node.inner_html)
548
+ # end
547
549
  doc.xpath('//item').each do |node|
548
550
  clean_node node, %w{id-text id label}
549
551
  node.name = 'li'
@@ -1,3 +1,3 @@
1
1
  module Polytexnic
2
- VERSION = "1.8.2"
2
+ VERSION = "1.9.1"
3
3
  end
@@ -139,6 +139,12 @@ describe 'Polytexnic::Pipeline#to_html' do
139
139
  it { should_not include 'intersentencespace' }
140
140
  end
141
141
 
142
+ context "with parens after a footnote" do
143
+ let(:polytex) { '(Lorem ipsum.\footnote{From \emph{Cicero}.}) Next' }
144
+ it { should include 'ipsum' }
145
+ it { should_not include 'intersentencespace' }
146
+ end
147
+
142
148
  context "with only a newline" do
143
149
  let(:polytex) { "Lorem ipsum.\nDolor sit amet." }
144
150
  it { should resemble "Lorem ipsum.#{intsp} Dolor sit amet." }
@@ -17,7 +17,7 @@ describe 'Polytexnic::Pipeline#to_html' do
17
17
 
18
18
  describe "item" do
19
19
  let(:polytex) { '\item foo' }
20
- it { should resemble "<li>foo\n</li>"}
20
+ it { should resemble %(<li><p class="noindent">foo\n</p></li>)}
21
21
  end
22
22
 
23
23
  describe "itemized list" do
@@ -33,8 +33,8 @@ describe 'Polytexnic::Pipeline#to_html' do
33
33
  it do
34
34
  should resemble <<-'EOS'
35
35
  <ul>
36
- <li>Foo</li>
37
- <li>Bar</li>
36
+ <li><p class="noindent">Foo</p></li>
37
+ <li><p class="noindent">Bar</p></li>
38
38
  </ul>
39
39
  EOS
40
40
  end
@@ -54,8 +54,8 @@ describe 'Polytexnic::Pipeline#to_html' do
54
54
  should resemble <<-'EOS'
55
55
  <p>lorem ipsum</p>
56
56
  <ul>
57
- <li>Foo</li>
58
- <li>Bar</li>
57
+ <li><p class="noindent">Foo</p></li>
58
+ <li><p class="noindent">Bar</p></li>
59
59
  </ul>
60
60
  EOS
61
61
  end
@@ -74,8 +74,8 @@ describe 'Polytexnic::Pipeline#to_html' do
74
74
  it do
75
75
  should resemble <<-'EOS'
76
76
  <ul>
77
- <li>Foo</li>
78
- <li>Bar</li>
77
+ <li><p class="noindent">Foo</p></li>
78
+ <li><p class="noindent">Bar</p></li>
79
79
  </ul><p>lorem ipsum
80
80
  </p>
81
81
  EOS
@@ -104,15 +104,15 @@ describe 'Polytexnic::Pipeline#to_html' do
104
104
  it do
105
105
  should resemble <<-'EOS'
106
106
  <ul>
107
- <li>foo
107
+ <li><p class="noindent">foo</p>
108
108
  <ul>
109
- <li>bar</li>
110
- <li>baz</li>
109
+ <li><p class="noindent">bar</p></li>
110
+ <li><p class="noindent">baz</p></li>
111
111
  </ul>
112
112
  </li>
113
- <li>quux
113
+ <li><p class="noindent">quux</p>
114
114
  <ul>
115
- <li>dude</li>
115
+ <li><p class="noindent">dude</p></li>
116
116
  </ul>
117
117
  </li>
118
118
  </ul>
@@ -132,10 +132,10 @@ describe 'Polytexnic::Pipeline#to_html' do
132
132
  it do
133
133
  should resemble <<-'EOS'
134
134
  <ol>
135
- <li>Foo</li>
136
- <li>Bar</li>
135
+ <li><p class="noindent">Foo</p></li>
136
+ <li><p class="noindent">Bar</p></li>
137
137
  </ol>
138
138
  EOS
139
139
  end
140
140
  end
141
- end
141
+ end
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.8.2
4
+ version: 1.9.1
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: 2023-06-30 00:00:00.000000000 Z
12
+ date: 2023-08-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri