wikitext 1.7 → 1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/ary.c +23 -0
- data/ext/ary.h +2 -0
- data/ext/parser.c +55 -45
- data/ext/wikitext_ragel.c +1156 -1018
- data/lib/wikitext/version.rb +1 -1
- data/spec/pre_spec.rb +19 -0
- metadata +2 -2
data/lib/wikitext/version.rb
CHANGED
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><pre lang="ruby">foo</pre></p>\n}
|
487
|
+
@parser.parse('<pre lang ="ruby">foo</pre>').should == %Q{<p><pre lang ="ruby">foo</pre></p>\n}
|
488
|
+
@parser.parse('<pre lang= "ruby">foo</pre>').should == %Q{<p><pre lang= "ruby">foo</pre></p>\n}
|
489
|
+
@parser.parse('<pre lang="ruby" >foo</pre>').should == %Q{<p><pre lang="ruby" >foo</pre></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><pre lang="obj-c">foo</pre></p>\n}
|
494
|
+
end
|
495
|
+
|
496
|
+
it 'should reject empty "lang" attributes' do
|
497
|
+
@parser.parse('<pre lang="">foo</pre>').should == %Q{<p><pre lang="">foo</pre></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.
|
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-
|
12
|
+
date: 2009-05-27 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|