Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge changed from head

  • Loading branch information...
commit ca6c0250fc3a7f3c161ce4ac47da6b2e5a2bfc7b 2 parents 395d182 + ae05d11
@Arcath authored
View
2  Rakefile
@@ -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
8 lib/trainbbcode/parse.rb
@@ -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
1  lib/trainbbcode/tags.rb
@@ -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
4 spec/trainbbcode_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.