class TBBC
Tags = [[/\[b\](.*?)\[\/b\]/,'\1',:strong_enabled],
[/\[i\](.*?)\[\/i\]/,'\1',:italic_enabled],
[/\[u\](.*?)\[\/u\]/,'\1',:underline_enabled],
[/\[url\](.*?)\[\/url\]/,'\1',:url_enabled],
[/\[url=(.*?)\](.*?)\[\/url\]/,'\2',:url_enabled],
[/\[url=(.*?) target=(.*?)\](.*?)\[\/url\]/,'\3',:url_enabled],
[/\[img\](.*?)\[\/img\]/,'',:image_enabled],
[/\[img alt=(.*?)\](.*?)\[\/img\]/,'',:image_enabled],
[/\[ul\](.*?)\[\/ul\]/,'
',:list_enabled],
[/\[ol\](.*?)\[\/ol\]/,'\1
',:list_enabled],
[/\[li\](.*?)\[\/li\]/,'\1',:list_enabled],
[/\[quote\](.*?)\[\/quote\]/,'\1
',:quote_enabled],
[/\[quote=(.*?)\](.*?)\[\/quote\]/,'Posted by \1
\2
',:quote_enabled],
[/\[color=(.*?)\](.*?)\[\/color\]/,'\2',:color_enabled],
[/\[center\](.*?)\[\/center\]/,'\1
',:alignment_enabled],
[/\[left\](.*?)\[\/left\]/,'\1
',:alignment_enabled],
[/\[right\](.*?)\[\/right\]/,'\1
',:alignment_enabled],
[/\[acronym=(.*?)\](.*?)\[\/acronym\]/,'\2',:acronym_enabled],
[/\[table\](.*?)\[\/table\]/,'',:table_enabled],
[/\[tr\](.*?)\[\/tr\]/,'\1
',:table_enabled],
[/\[td\](.*?)\[\/td\]/,'\1 | ',:table_enabled],
[/\[th\](.*?)\[\/th\]/,'\1 | ',:table_enabled]]
private
# Runs the given tag array on the given string.
def runtag(s,tag)
check = tag[2]
check = @config[tag[2]] if is_symbol? tag[2]
s=s.gsub(tag[0],replace_config_values(tag[1])) unless check == false
s
end
def is_symbol?(v)
v == v.to_sym
end
def replace_config_values(s)
if s.scan(/@config\[:(.*?)\]/) != [] then
return s.gsub(/@config\[:(.*?)\]/,@config[$1.to_sym])
else
return s
end
end
end