polytexnic 0.8.1 → 0.8.2

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: 4a2df43fa50a04aa19a8770e60ea9ec2b426015e
4
- data.tar.gz: e81a69815be32543b785e56a3514e4c36647b2b2
3
+ metadata.gz: 93f94c2e4866339d2cea4731e55fa4963774d985
4
+ data.tar.gz: f15a6846bd39ba6d567d40cf6060910698640d38
5
5
  SHA512:
6
- metadata.gz: 9e2864c20e611c04ba188263d0c915d55d8ae0967a83b4ea9ffd5bd00f12bcc005a0807861db6f5165a6f5cbfa11aaf065575e82a06e9e5c393559fd0261658d
7
- data.tar.gz: 2f3c38287429bbecd228b3d11aba90a8489540bf567bfc986f594c270d08df0671327823ec4364ad3290463cc986d2c4935a3d5b64607ac6df9bab423bba81bd
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 + %w[tabular tabularx]
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 =~ /^```\s*$/ # basic code fences
218
- while (line = lines.shift) && !line.match(/^```\s*$/)
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
@@ -1,3 +1,3 @@
1
1
  module Polytexnic
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
@@ -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
- \begin{verbatim}
459
+ %= lang:text
460
+ \begin{code}
447
461
  def foo
448
462
  "bar"
449
463
  end
450
- \end{verbatim}
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.1
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-04 00:00:00.000000000 Z
12
+ date: 2014-01-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri