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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/polytexnic/postprocessors/html.rb +6 -4
- data/lib/polytexnic/version.rb +1 -1
- data/spec/to_html/characters_and_punctuation_spec.rb +6 -0
- data/spec/to_html/lists_spec.rb +15 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b5dc960f818c0dd1342080a1d886582ecdd67a8ccf7688cae86e79c18309278
|
4
|
+
data.tar.gz: 24f2ce7be9a136c54aacab4a78d47ff17598182c8095038c95c6a215ab0c45f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
|
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
|
-
|
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'
|
data/lib/polytexnic/version.rb
CHANGED
@@ -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." }
|
data/spec/to_html/lists_spec.rb
CHANGED
@@ -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
|
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.
|
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-
|
12
|
+
date: 2023-08-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|