Skip to content

Commit

Permalink
Added support for white text on black background
Browse files Browse the repository at this point in the history
  • Loading branch information
bobes committed Oct 25, 2011
1 parent 410b73d commit 86f07cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ansi2html.gemspec
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |s|
s.name = 'ansi2html'
s.version = '5.3.2'
s.version = '5.3.3'
s.authors = ["Aslak Hellesøy"]
s.description = 'Convert ANSI escape sequences to styleable HTML markup'
s.summary = "#{s.name}-#{s.version}"
Expand Down
8 changes: 6 additions & 2 deletions lib/ansi2html/main.rb
Expand Up @@ -16,16 +16,20 @@ class Main
}

def self.execute
new(STDIN.read, STDOUT, ARGV.index('--envelope'))
new(STDIN.read, STDOUT, ARGV.index('--envelope'), ARGV.index('--black'))
end

def initialize(ansi, out, envelope=false)
def initialize(ansi, out, envelope=false, black=false)
if(envelope)
background, color = black ? %w(black white) : %w(white black)
out.print %{<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<style>
body {
background-color: #{background}; color: #{color};
}
.bold {
font-weight: bold;
}
Expand Down

0 comments on commit 86f07cf

Please sign in to comment.