wikitext 1.5.0 → 1.5.1
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.
- data/lib/wikitext/string.rb +2 -2
- data/lib/wikitext/version.rb +1 -1
- data/spec/string_spec.rb +5 -0
- metadata +2 -2
data/lib/wikitext/string.rb
CHANGED
@@ -15,8 +15,8 @@
|
|
15
15
|
require 'wikitext/parser'
|
16
16
|
|
17
17
|
class String
|
18
|
-
def to_wikitext
|
19
|
-
Wikitext::Parser.shared_parser.parse wikitext_preprocess
|
18
|
+
def to_wikitext options = {}
|
19
|
+
Wikitext::Parser.shared_parser.parse wikitext_preprocess, options
|
20
20
|
end
|
21
21
|
alias :w :to_wikitext
|
22
22
|
|
data/lib/wikitext/version.rb
CHANGED
data/spec/string_spec.rb
CHANGED
@@ -24,4 +24,9 @@ describe String, 'wikitext extensions' do
|
|
24
24
|
it 'should provide a w method on all strings' do
|
25
25
|
"'''strong'''".w.should == "<p><strong>strong</strong></p>\n"
|
26
26
|
end
|
27
|
+
|
28
|
+
# the options get passed along to the parser
|
29
|
+
it 'should accept an optional options hash' do
|
30
|
+
"= foo =".w(:base_heading_level => 2).should == "<h3>foo</h3>\n"
|
31
|
+
end
|
27
32
|
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.5.
|
4
|
+
version: 1.5.1
|
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-
|
12
|
+
date: 2009-03-17 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|