polytexnic 0.7.2 → 0.7.3

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
  SHA1:
3
- metadata.gz: 6b4c121bf68950ca38bc3289bba23be0aefc1dbc
4
- data.tar.gz: 95bede188fb95eb68d77d6f5649bc0e13fce0e82
3
+ metadata.gz: 50ed75b9b53138ba115a7af87b3dc690e4dbcf70
4
+ data.tar.gz: d9a7c85d261e77667c483163c299434e7099a9b7
5
5
  SHA512:
6
- metadata.gz: 08b4f08b13293443da017c949961a42d35e843259c44ccbcb0d2902452e2bf4f1efbcd4bdca55fef27eb4d5b9d30b813e1810226761360bcb8b84024e3d2b903
7
- data.tar.gz: b354bb460db2386757b17f6665fa24a0e3ea538d744878bc6b6a4926cd61b3cd80fd9059a04253e82be7a9e5a2c32af525ff851c36763c40de08ce4af5fbac9f
6
+ metadata.gz: 124b21054c5e3f1cad103613afeeb1b6c139ff52a5d588e5374b4cf195e73d9752884e6da60480431f3cf6802479be3f5bd8aea3d2f877605e588e17d91ed81c
7
+ data.tar.gz: 5604d325b1edabdef96de6a27cfdd26cd8b7fda8f5af91448c7c3606a68207866d1137551565b661cbbff8ad3fe95eb65b2cca5eb12332f628cf3d5a7cbbc0e1
@@ -111,6 +111,7 @@ module Polytexnic
111
111
  text = []
112
112
  text << line if line.math_environment? || (latex && !language)
113
113
  while (line = lines.shift)
114
+ puts line.inspect if debug?
114
115
  if line.begin_literal?(literal_type)
115
116
  count += 1
116
117
  elsif line.end_literal?(literal_type)
@@ -126,6 +127,7 @@ module Polytexnic
126
127
  end
127
128
  raise "Missing \\end{#{line.literal_type}}" if count != 0
128
129
  content = text.join("\n")
130
+ puts content.inspect if debug?
129
131
  if math
130
132
  key = digest(content)
131
133
  literal_cache[key] = content
@@ -168,7 +170,7 @@ module Polytexnic
168
170
  end
169
171
  end
170
172
 
171
- # Returns a permanent salt syntax highlighting cache.
173
+ # Returns a permanent salt for the syntax highlighting cache.
172
174
  def code_salt
173
175
  'fbbc13ed4a51e27608037365e1d27a5f992b6339'
174
176
  end
@@ -9,10 +9,17 @@ module Polytexnic
9
9
  puts polytex if debug?
10
10
  polytex.tap do
11
11
  literal_cache.each do |key, value|
12
- polytex.gsub!(key, escape_backslashes(value))
12
+ puts value.inspect if debug?
13
+ polytex.gsub!(key, extra_escape(escape_backslashes(value)))
13
14
  end
14
15
  end
15
16
  end
17
+
18
+ # Escapes backslashes even more.
19
+ # Have I mentioned how much I hate backslashes?
20
+ def extra_escape(string)
21
+ string.gsub('\\', '\\\\\\')
22
+ end
16
23
  end
17
24
  end
18
25
  end
@@ -1,3 +1,3 @@
1
1
  module Polytexnic
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
@@ -80,7 +80,7 @@ end
80
80
  it { should_not resemble '%= lang:ruby' }
81
81
  end
82
82
 
83
- describe "verbatim environments" do
83
+ describe "Verbatim environments" do
84
84
  let(:polytex) do <<-'EOS'
85
85
  \begin{verbatim}
86
86
  def foo
@@ -134,6 +134,17 @@ end
134
134
  expect(n_ends).to eq 1
135
135
  end
136
136
  end
137
+
138
+ context "with code from Urbit docs that broke things" do
139
+ let(:polytex) do <<-'EOS'
140
+ \begin{verbatim}
141
+ ~waclux-tomwyc/try=> 'Foo \'bar'
142
+ \end{verbatim}
143
+ EOS
144
+ end
145
+
146
+ it { should include "'Foo \\'bar'" }
147
+ end
137
148
  end
138
149
 
139
150
  describe "hyperref links" 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: 0.7.2
4
+ version: 0.7.3
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: 2013-12-10 00:00:00.000000000 Z
12
+ date: 2013-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri