")
line.gsub!(/\[ALIGN=left\]/i, "")
line.gsub!(/\[\/ALIGN\]/i, "")
## QUOTE
quote+=1 if line =~ /\[QUOTE\]/i
quote-=1 if (line =~ /\[\/QUOTE\]/i) && (quote > -1)
line.gsub!(/\[QUOTE\]/i, "\n")
line.gsub!(/\[\/QUOTE\]/i, "
\n")
line.gsub!(/^/, ">"*quote) if quote > 0
## EMAIL
line.gsub!(/\[EMAIL\](.*?)\[\/EMAIL\]/i, "\\1")
## LIST (TODO: LIST=1, LIST=A)
line.gsub!(/\[LIST(?:=(.*?))?\]/i, "\n\n")
line.gsub!(/\[\/LIST\]/i, "\n
\n")
line.gsub!(/\[\*\]/i, "\n")
## FONT => font ??????
## ?BLUR?, FADE?
result << sprintf("%s
\n", line)
end
return result
end
# -- Transitive methods ---------------
# Converts an ANSI string to one with HTML markup.
# Returns the string with ANSI code sequences converted to XHTML markup.
def BBCode.ansi_to_html(string)
bbcoded = BBCode.ansi_to_bbcode(string )
htmled = BBCode.bbcode_to_html(bbcoded)
return htmled
end
# Returns the (X)HTML markup code as ANSI sequences
def BBCode.html_to_ansi(string)
bbcoded = BBCode.html_to_bbcode(string )
ansied = BBCode.bbcode_to_ansi(bbcoded)
return ansied
end
end #module BBCode
end