polytexnic 1.9.0 → 1.9.2

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: 661a979e224cca511cb29bf8b4268cd5a003b2b540dd9a9f249813f448aa346d
4
- data.tar.gz: 740758da8a65f87cd934a4e7ed47525adae3e9760d0a5981f93256f177a7e021
3
+ metadata.gz: 7fd013155e321745a2fa54c50bfc39826c9908e3cd6fa4aca280197c805cb6f3
4
+ data.tar.gz: cf219afa3a0f99c57536bbf9e5e75776515b56b3eec36b3ccd5f4a9adc63c597
5
5
  SHA512:
6
- metadata.gz: 87990735c902b06126f371ee8da891b74c54efe609026a27d333b38653ccfc1e0e34dd1140f8ca50b6ea496b998dee77e481a55eac714de67b60a3ca26b07375
7
- data.tar.gz: 2f535ccba676cd8dc3adea72fe87b8728d7579d0c5ba12004694bdf3a5c59b48621f82a3d8abed39c344063e27a98aa165fdf49cf60cd481534788c95ed324e7
6
+ metadata.gz: 916e1ed5f71cf96fa311426dd8e87bd52e3fd0a0884744085dc9400da972d9648c3216e2c45b33bb50c1a77cbc08322e11ad8f1b8fb6620cd25fa6f69ee62ec1
7
+ data.tar.gz: a14021cf2f3d7f1d5634bb81198490baab22116484207392841107b1bcb86e9d814d6dedc01fba3b1e58320e28dff459a0e621b0d85f7e4472231c15ce8dacdf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- polytexnic (1.9.0)
4
+ polytexnic (1.9.2)
5
5
  json (= 2.3.1)
6
6
  kramdown (= 2.4.0)
7
7
  msgpack (= 1.2.10)
@@ -23,14 +23,9 @@ module Polytexnic
23
23
  %w[align* eqnarray* equation* gather* multline*]
24
24
  end
25
25
 
26
- def math_environments_starred
27
- %w[align* eqnarray* equation* gather* multline*]
28
- end
29
-
30
26
  # Returns a list of all literal types.
31
27
  def literal_types
32
- %w[verbatim Vertatim code metacode] +
33
- math_environments
28
+ %w[verbatim Vertatim code metacode] + math_environments
34
29
  end
35
30
 
36
31
  # Handles environments that should be passed through the pipeline intact.
@@ -83,8 +78,6 @@ module Polytexnic
83
78
  literal_type = line.literal_type
84
79
  skip = line.math_environment? || latex
85
80
  if line.math_environment? && !latex
86
- # puts line
87
- # puts "****"
88
81
  output << '\begin{xmlelement*}{equation}'
89
82
  if line.starred?
90
83
  output << '\begin{equation*}'
@@ -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
@@ -18,7 +18,9 @@ module Polytexnic
18
18
  # Escapes backslashes even more.
19
19
  # Have I mentioned how much I hate backslashes?
20
20
  def extra_escape(string)
21
- string.gsub('\\', '\\\\\\')
21
+ string.gsub('\\', '\\\\\\').
22
+ gsub("\\'", '\\\\' + "'").
23
+ gsub('\\\\\\', '\\\\\\')
22
24
  end
23
25
  end
24
26
  end
@@ -1,3 +1,3 @@
1
1
  module Polytexnic
2
- VERSION = "1.9.0"
2
+ VERSION = "1.9.2"
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." }
@@ -103,6 +103,19 @@ end
103
103
 
104
104
  it { should resemble polytex }
105
105
 
106
+ context "align* environment" do
107
+ let(:polytex) do <<-'EOS'
108
+ \begin{align*}
109
+ x &= 1\\
110
+ y & = 2 \\
111
+ x + y &= 3
112
+ \end{align*}
113
+ EOS
114
+ end
115
+
116
+ it { should resemble polytex }
117
+ end
118
+
106
119
  context "containing an example of highlighted code" do
107
120
  let(:polytex) do <<-'EOS'
108
121
  \begin{verbatim}
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.9.0
4
+ version: 1.9.2
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-08-18 00:00:00.000000000 Z
12
+ date: 2023-08-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri