From a47a89f4ae8dfa6f8d0f5fefac043cba7a995a3c Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Fri, 26 Mar 2021 10:36:23 -0400 Subject: [PATCH] Remove setting for underlining and striking whitespace --- color.go | 4 ++-- set.go | 18 ------------------ style.go | 13 +------------ unset.go | 14 -------------- 4 files changed, 3 insertions(+), 46 deletions(-) diff --git a/color.go b/color.go index 425d27a..d8f54fa 100644 --- a/color.go +++ b/color.go @@ -42,8 +42,8 @@ func (c Color) value() string { return string(c) } -// AdaptiveColor provides color alternatives for light and dark backgrounds. -// The appropriate color with be returned based on the darkness of the terminal +// AdaptiveColor provides color options for light and dark backgrounds. The +// appropriate color with be returned based on the darkness of the terminal // background color determined at runtime. // // Example usage: diff --git a/set.go b/set.go index e1515ed..878036a 100644 --- a/set.go +++ b/set.go @@ -466,24 +466,6 @@ func (s Style) MaxHeight(n int) Style { return o } -// UnderlineWhitespace determines whether to draw underlines in areas outside -// text blocks. By default this is false, but it can be enabled for certain -// graphic effects. Also note that whitespace can be underlined without -// underlining text. -func (s Style) UnderlineWhitespace(v bool) Style { - s.set(underlineWhitespaceKey, v) - return s -} - -// StrikethroughWhitespace determines whether to draw strikethroughs in areas -// outside text blocks. By default this is false, but it can be enabled for -// certain graphic effects. Also note that whitespace can be struck without -// striking through text. -func (s Style) StrikethroughWhitespace(v bool) Style { - s.set(strikethroughWhitespaceKey, v) - return s -} - // UnderlineSpaces determines whether to underline spaces between words. By // default this is true. Spaces can also be underlined without underlining the // text itself. diff --git a/style.go b/style.go index cc18bbe..e475708 100644 --- a/style.go +++ b/style.go @@ -52,8 +52,6 @@ const ( inlineKey maxWidthKey maxHeightKey - underlineWhitespaceKey - strikethroughWhitespaceKey underlineSpacesKey strikethroughSpacesKey ) @@ -162,15 +160,12 @@ func (s Style) Render(str string) string { maxWidth = s.getAsInt(maxWidthKey) maxHeight = s.getAsInt(maxHeightKey) - underlineWhitespace = s.getAsBool(underlineWhitespaceKey, false) - strikethroughWhitespace = s.getAsBool(strikethroughWhitespaceKey, false) - underlineSpaces = underline && s.getAsBool(underlineSpacesKey, true) strikethroughSpaces = strikethrough && s.getAsBool(strikethroughSpacesKey, true) // Do we need to style whitespace (padding and space outsode // paragraphs) separately? - styleWhitespace = reverse || underlineWhitespace || strikethroughWhitespace + styleWhitespace = reverse // Do we need to style spaces separately? useSpaceStyler = underlineSpaces || strikethroughSpaces @@ -228,12 +223,6 @@ func (s Style) Render(str string) string { te = te.CrossOut() } - if underlineWhitespace { - teWhitespace = teWhitespace.Underline() - } - if strikethroughWhitespace { - teWhitespace = teWhitespace.CrossOut() - } if underlineSpaces { teSpace = teSpace.Underline() } diff --git a/unset.go b/unset.go index 1efe666..1278e06 100644 --- a/unset.go +++ b/unset.go @@ -275,20 +275,6 @@ func (s Style) UnsetMaxHeight() Style { return s } -// UnsetUnderlineWhitespace removes the rule for underlining whitespace, if -// set. -func (s Style) UnsetUnderlineWhitespace() Style { - delete(s.rules, underlineSpacesKey) - return s -} - -// UnsetUnderlineWhitespace removes the rule for strikingn through whitespace, -// if set. -func (s Style) UnsetStrikethroughWhitespace() Style { - delete(s.rules, strikethroughSpacesKey) - return s -} - // UnsetUnderlineSpaces removes the value set by UnderlineSpaces. func (s Style) UnsetUnderlineSpaces() Style { delete(s.rules, underlineSpacesKey)