polytexnic 0.6.10 → 0.6.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/polytexnic/literal.rb +1 -2
- data/lib/polytexnic/version.rb +1 -1
- data/spec/to_html/literal_environments/code_spec.rb +14 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57bbac0600d61db44cc14762bacc2a24594ab2c9
|
4
|
+
data.tar.gz: fa73a4ee9071da8a1cd15c8bdc8224fd40368cee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e8b902671181b3e01162ee6aa1a6f8882e1b72d02364c33854b97922803771d1e23d0e9137adc3f5a743fa8c9694601afa916ba20a5d673d0c7b3a839ba8960
|
7
|
+
data.tar.gz: 1e7f38cb586cce81529f9d3b29a5c732ad3176afa4bda9a56b834a0abcafc463e966173c0391de26cd31a69f70d87d9bc490357bab03d47091784e34de3ef69f
|
data/lib/polytexnic/literal.rb
CHANGED
@@ -87,8 +87,7 @@ module Polytexnic
|
|
87
87
|
if File.exist?(filename)
|
88
88
|
language = $3 || $2 || 'text'
|
89
89
|
highlight_options = $4
|
90
|
-
code = ["%= lang:#{language}"]
|
91
|
-
code << highlight_options unless highlight_options.nil?
|
90
|
+
code = ["%= lang:#{language}#{highlight_options}"]
|
92
91
|
code << '\begin{code}'
|
93
92
|
code.concat(File.read($1).split("\n"))
|
94
93
|
code << '\end{code}'
|
data/lib/polytexnic/version.rb
CHANGED
@@ -118,6 +118,7 @@ describe Polytexnic::Pipeline do
|
|
118
118
|
end
|
119
119
|
|
120
120
|
describe "code inclusion" do
|
121
|
+
|
121
122
|
context "for an existing file" do
|
122
123
|
|
123
124
|
context "with no extension" do
|
@@ -149,7 +150,7 @@ describe Polytexnic::Pipeline do
|
|
149
150
|
|
150
151
|
context "with a custom language override" do
|
151
152
|
let(:polytex) do <<-'EOS'
|
152
|
-
%= <<
|
153
|
+
%= <<(polytexnic_commands.sty, lang: tex)
|
153
154
|
EOS
|
154
155
|
end
|
155
156
|
let(:output) do <<-'EOS'
|
@@ -159,6 +160,18 @@ describe Polytexnic::Pipeline do
|
|
159
160
|
it { should resemble output }
|
160
161
|
it { should_not include '<p></p>' }
|
161
162
|
end
|
163
|
+
|
164
|
+
context "with custom options" do
|
165
|
+
let(:polytex) do <<-'EOS'
|
166
|
+
%= <<(polytexnic_commands.sty, lang: tex, options: "hl_lines": [5])
|
167
|
+
EOS
|
168
|
+
end
|
169
|
+
let(:output) do <<-'EOS'
|
170
|
+
<span class="hll">
|
171
|
+
EOS
|
172
|
+
end
|
173
|
+
it { should resemble output }
|
174
|
+
end
|
162
175
|
end
|
163
176
|
|
164
177
|
|