wikitext 1.7 → 1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,5 +22,5 @@
22
22
  # POSSIBILITY OF SUCH DAMAGE.
23
23
 
24
24
  module Wikitext
25
- VERSION = '1.7'
25
+ VERSION = '1.8'
26
26
  end # module Wikitext
data/spec/pre_spec.rb CHANGED
@@ -477,4 +477,23 @@ describe Wikitext::Parser, 'parsing PRE_START/PRE_END blocks' do
477
477
  it 'should automatically close open PRE_START blocks on hitting the end-of-file' do
478
478
  @parser.parse('<pre>foo').should == "<pre>foo</pre>\n"
479
479
  end
480
+
481
+ it 'should handle an optional "lang" attribute' do
482
+ @parser.parse('<pre lang="ruby">foo</pre>').should == %Q{<pre class="ruby-syntax">foo</pre>\n}
483
+ end
484
+
485
+ it 'should reject excess internal whitespace in PRE_START tags which have a "lang" attribute' do
486
+ @parser.parse('<pre lang="ruby">foo</pre>').should == %Q{<p>&lt;pre lang=&quot;ruby&quot;&gt;foo&lt;/pre&gt;</p>\n}
487
+ @parser.parse('<pre lang ="ruby">foo</pre>').should == %Q{<p>&lt;pre lang =&quot;ruby&quot;&gt;foo&lt;/pre&gt;</p>\n}
488
+ @parser.parse('<pre lang= "ruby">foo</pre>').should == %Q{<p>&lt;pre lang= &quot;ruby&quot;&gt;foo&lt;/pre&gt;</p>\n}
489
+ @parser.parse('<pre lang="ruby" >foo</pre>').should == %Q{<p>&lt;pre lang=&quot;ruby&quot; &gt;foo&lt;/pre&gt;</p>\n}
490
+ end
491
+
492
+ it 'should reject non-alpha characters in "lang" attribute' do
493
+ @parser.parse('<pre lang="obj-c">foo</pre>').should == %Q{<p>&lt;pre lang=&quot;obj-c&quot;&gt;foo&lt;/pre&gt;</p>\n}
494
+ end
495
+
496
+ it 'should reject empty "lang" attributes' do
497
+ @parser.parse('<pre lang="">foo</pre>').should == %Q{<p>&lt;pre lang=&quot;&quot;&gt;foo&lt;/pre&gt;</p>\n}
498
+ end
480
499
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wikitext
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.7"
4
+ version: "1.8"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wincent Colaiuta
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-13 00:00:00 +02:00
12
+ date: 2009-05-27 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies: []
15
15