Browse files

Differentiate between foreground and background classes

  • Loading branch information...
1 parent 5c755d5 commit ab2c373e55f2848f0242f39690c50403ecf32518 @jamesrwhite jamesrwhite committed Feb 26, 2014
Showing with 3 additions and 3 deletions.
  1. +1 −1 Readme.md
  2. +2 −2 ansi_up.js
View
2 Readme.md
@@ -59,7 +59,7 @@ This replaces any links in the text with anchor tags that display the link. The
This replaces ANSI terminal escape codes with SPAN tags that wrap the content. By default the styles are inline on the SPAN tags.
-The options parameter is optional and if you pass an object with the key/value pair 'use_classes: true' classes will be set on the SPAN tag instead of inline styles. The classes used are of the format ansi-* and ansi-bright-* where * is the colour name, i.e black/red/green/yellow/blue/magenta/cyan/white.
+The options parameter is optional and if you pass an object with the key/value pair 'use_classes: true' classes will be set on the SPAN tag instead of inline styles. The classes used are of the format ````ansi-*-fg/bg```` and ````ansi-bright-*-fg/bg```` where * is the colour name, i.e black/red/green/yellow/blue/magenta/cyan/white.
## Building
View
4 ansi_up.js
@@ -120,14 +120,14 @@
var styles = classes = [];
if (self.fg) {
if (use_classes) {
- classes.push(self.fg);
+ classes.push(self.fg + "-fg");
} else {
styles.push("color:rgb(" + self.fg + ")");
}
}
if (self.bg) {
if (use_classes) {
- classes.push(self.bg);
+ classes.push(self.bg + "-bg");
} else {
styles.push("background-color:rgb(" + self.bg + ")");
}

0 comments on commit ab2c373

Please sign in to comment.