diff --git a/src/actions.cr b/src/actions.cr index 95cddcd..f35f225 100644 --- a/src/actions.cr +++ b/src/actions.cr @@ -4,6 +4,7 @@ require "./formatter" require "./rules" require "./styles" require "./tartrazine" + # These are Lexer actions. When a rule matches, it will # perform a list of actions. These actions can emit tokens # or change the state machine. diff --git a/src/formatter.cr b/src/formatter.cr index d772f77..2cb168c 100644 --- a/src/formatter.cr +++ b/src/formatter.cr @@ -44,7 +44,12 @@ module Tartrazine theme.styles.has_key?(parent) }] end - text.colorize(*rgb(s.color)).back(*rgb(s.background)).to_s + colorized = text.colorize(*rgb(s.color)) + # Intentionally not setting background color + colorized.mode(:bold) if s.bold + colorized.mode(:italic) if s.italic + colorized.mode(:underline) if s.underline + colorized.to_s end def rgb(c : String?)