From 0a09075b6fdf94bfcca5ded58dd685682a2ae9d4 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Tue, 29 Nov 2011 00:28:26 +0100 Subject: [PATCH] Underline SGR code support --- app/assets/javascripts/terminal.js.coffee | 11 ++++++++++- app/assets/stylesheets/asciicasts.css.scss | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/terminal.js.coffee b/app/assets/javascripts/terminal.js.coffee index be11111..96e4864 100644 --- a/app/assets/javascripts/terminal.js.coffee +++ b/app/assets/javascripts/terminal.js.coffee @@ -10,6 +10,7 @@ class AsciiIo.Terminal @lineData = @normalBuffer @dirtyLines = [] @fg = @bg = undefined + @underline = false @createChildElements() @showCursor true @@ -104,8 +105,13 @@ class AsciiIo.Terminal if n is 0 @fg = @bg = undefined @bright = false + @underline = false else if n is 1 @bright = true + else if n is 4 + @underline = true + else if n is 24 + @underline = false else if n >= 30 and n <= 37 @fg = n - 30 else if n >= 40 and n <= 47 @@ -274,7 +280,7 @@ class AsciiIo.Terminal prefix = "" postfix = "" - if @fg isnt undefined or @bg isnt undefined or @bright + if @fg isnt undefined or @bg isnt undefined or @bright or @underline prefix = "" postfix = "" diff --git a/app/assets/stylesheets/asciicasts.css.scss b/app/assets/stylesheets/asciicasts.css.scss index 77c2736..5bba636 100644 --- a/app/assets/stylesheets/asciicasts.css.scss +++ b/app/assets/stylesheets/asciicasts.css.scss @@ -57,6 +57,7 @@ } .bright { font-weight: bold } +.underline { text-decoration: underline } /* Foregrounds: */