Permalink
Browse files

Merge changed from head

  • Loading branch information...
2 parents 395d182 + ae05d11 commit ca6c0250fc3a7f3c161ce4ac47da6b2e5a2bfc7b @Arcath committed Oct 25, 2010
Showing with 10 additions and 5 deletions.
  1. +1 −1 Rakefile
  2. +4 −4 lib/trainbbcode/parse.rb
  3. +1 −0 lib/trainbbcode/tags.rb
  4. +4 −0 spec/trainbbcode_spec.rb
View
@@ -2,7 +2,7 @@ require 'rubygems'
require 'rake'
require 'echoe'
-Echoe.new('trainbbcode','1.0.0') do |p|
+Echoe.new('trainbbcode','1.0.1') do |p|
p.description = "Provides BBCode for Ruby."
p.url = "http://www.arcath.net/"
p.author = "Adam \"Arcath\" Laycock"
View
@@ -16,15 +16,15 @@ def parse(input)
#Swear Filtering
input=swear_filter(input) unless @config[:swear_filter_enabled] == false
#Loading Custom Tags
- begin
+ #begin
if @config[:custom_tags] then
@config[:custom_tags].each do |tag|
input=runtag(input,tag)
end
end
- rescue
- input+="<br />Custom Tags failed to run"
- end
+ #rescue
+ #input+="<br />Custom Tags failed to run"
+ #end
#Loading Default Tags and applying them
if @config[:allow_defaults] then
TBBC::Tags.each do |tag|
View
@@ -33,6 +33,7 @@ def runtag(s,tag)
end
def is_symbol?(v)
+ return false if (v == true or v == false)
v == v.to_sym
end
View
@@ -14,4 +14,8 @@
it "Should return <strong>BOLD [i]italics[/i]</strong> when italics are disabled" do
"[b]BOLD [i]italics[/i][/b]".tbbc(:italic_enabled => false).should == "<strong>BOLD [i]italics[/i]</strong>"
end
+
+ it "Should allow custom tags to run and return <strong><i>BOLD italics</i></strong> for [bi]BOLD italics[/bi]" do
+ "[bi]BOLD italics[/bi]".tbbc(:custom_tags => [[/\[bi\](.*?)\[\/bi\]/,'<strong><i>\1</i></strong>',true]]).should == "<strong><i>BOLD italics</i></strong>"
+ end
end

0 comments on commit ca6c025

Please sign in to comment.