def render(format = :html, css_class = 'screen', css_style = nil)
			result = case format
			when :text
				''
			when :html
				%Q|<pre#{css_class ? %Q[ class="#{css_class}"] : ''}#{css_style ? %Q| style="#{css_style}"| : ''}>\n|
			else
				raise AnsiSysError, "Invalid format option to render: #{format.inspect}"
			end

			unless @lines.keys.empty?
				prev_sgr = nil
				max_row = @lines.keys.max
				(1..max_row).each do |row|
					if @lines.has_key?(row) and not @lines[row].keys.empty?
						col = 1
						while col <= @lines[row].keys.max
							if @lines[row].has_key?(col) and @lines[row][col]
								char, width, sgr = @lines[row][col]
								if prev_sgr != sgr
									result += prev_sgr.render(format, :postfix, @colors) if prev_sgr
									result += sgr.render(format, :prefix, @colors)
									prev_sgr = sgr
								end
								case format
								when :text
									result += char
								when :html
									result += WEBrick::HTMLUtils.escape(char)
								end
								col += width
							else
								result += ' '
								col += 1
							end
						end
					end
					result += "\n" if row < max_row
				end
				result += prev_sgr.render(format, :postfix, @colors) if prev_sgr
			end

			result += case format
			when :text
				''
			when :html
				'</pre>'
			end
			return result
		end
def render(format = :html, css_class = 'screen', css_style = nil)
			result = case format
			when :text
				''
			when :html
				%Q|<pre#{css_class ? %Q[ class="#{css_class}"] : ''}#{css_style ? %Q| style="#{css_style}"| : ''}>\n|
			else
				raise AnsiSysError, "Invalid format option to render: #{format.inspect}"
			end

			unless @lines.keys.empty?
				prev_sgr = nil
				max_row = @lines.keys.max
				(1..max_row).each do |row|
					if @lines.has_key?(row) and not @lines[row].keys.empty?
						col = 1
						while col <= @lines[row].keys.max
							if @lines[row].has_key?(col) and @lines[row][col]
								char, width, sgr = @lines[row][col]
								if prev_sgr != sgr
									result += prev_sgr.render(format, :postfix, @colors) if prev_sgr
									result += sgr.render(format, :prefix, @colors)
									prev_sgr = sgr
								end
								case format
								when :text
									result += char
								when :html
									result += WEBrick::HTMLUtils.escape(char)
								end
								col += width
							else
								result += ' '
								col += 1
							end
						end
					end
					result += "\n" if row < max_row
				end
				result += prev_sgr.render(format, :postfix, @colors) if prev_sgr
			end

			result += case format
			when :text
				''
			when :html
				'</pre>'
			end
			return result
		end
render the characters into :html or :text
 Class name in CSS can be specified as _css_class_.
 Additional stylelet can be specified as _css_style_.