polytexnic 0.8.1 → 0.8.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 +4 -4
- data/lib/polytexnic/preprocessors/polytex.rb +4 -8
- data/lib/polytexnic/version.rb +1 -1
- data/spec/markdown_to_polytex_spec.rb +16 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93f94c2e4866339d2cea4731e55fa4963774d985
|
4
|
+
data.tar.gz: f15a6846bd39ba6d567d40cf6060910698640d38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bca25d2db6b2d84918031fe1dfe32da9dd929eefffc892654486930d554bc631da22910d662026796892b64f4b8e86cfb44d67786f29b14bde312bd34d933860
|
7
|
+
data.tar.gz: 332fc4c67051c89e0c3854a4d02a4d60314f5b0ff28f77c7647b520ef30a236c17a8dcc9d085cad3512fd59864f6ca48b3ca2d9023fecaeb97b110eb9b8d3967
|
@@ -122,7 +122,8 @@ module Polytexnic
|
|
122
122
|
# Caches literal LaTeX environments.
|
123
123
|
def cache_latex_literal(markdown)
|
124
124
|
# Add tabular and tabularx support.
|
125
|
-
literal_types = Polytexnic::Literal.literal_types +
|
125
|
+
literal_types = Polytexnic::Literal.literal_types +
|
126
|
+
%w[tabular tabularx longtable]
|
126
127
|
literal_types.each do |literal|
|
127
128
|
regex = /(\\begin\{#{Regexp.escape(literal)}\}
|
128
129
|
.*?
|
@@ -214,13 +215,8 @@ module Polytexnic
|
|
214
215
|
code_cache[key] = [code, language]
|
215
216
|
output << key
|
216
217
|
output << line
|
217
|
-
elsif line =~
|
218
|
-
|
219
|
-
output << indentation + line
|
220
|
-
end
|
221
|
-
output << "\n"
|
222
|
-
elsif line =~ /^```(\w+)(,\s*options:.*)?$/ # highlighted fences
|
223
|
-
language = $1
|
218
|
+
elsif line =~ /^```(\w*)(,\s*options:.*)?$/ # highlighted fences
|
219
|
+
language = $1.empty? ? 'text' : $1
|
224
220
|
options = $2
|
225
221
|
code = []
|
226
222
|
while (line = lines.shift) && !line.match(/^```\s*$/) do
|
data/lib/polytexnic/version.rb
CHANGED
@@ -365,6 +365,19 @@ def foo; "bar"; end
|
|
365
365
|
end
|
366
366
|
it { should resemble source }
|
367
367
|
end
|
368
|
+
|
369
|
+
context "a raw longtable environment" do
|
370
|
+
let(:source) do <<-'EOS'
|
371
|
+
\begin{longtable}{|c|c|}
|
372
|
+
a & b \\
|
373
|
+
c & d \\
|
374
|
+
\hline
|
375
|
+
\caption{Foo bar.}
|
376
|
+
\end{longtable}
|
377
|
+
EOS
|
378
|
+
end
|
379
|
+
it { should resemble source }
|
380
|
+
end
|
368
381
|
end
|
369
382
|
|
370
383
|
describe "source code" do
|
@@ -443,11 +456,12 @@ lorem
|
|
443
456
|
end
|
444
457
|
|
445
458
|
let(:output) do <<-'EOS'
|
446
|
-
|
459
|
+
%= lang:text
|
460
|
+
\begin{code}
|
447
461
|
def foo
|
448
462
|
"bar"
|
449
463
|
end
|
450
|
-
\end{
|
464
|
+
\end{code}
|
451
465
|
lorem
|
452
466
|
EOS
|
453
467
|
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: 0.8.
|
4
|
+
version: 0.8.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: 2014-01-
|
12
|
+
date: 2014-01-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|