diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Blessings.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Blessings.hs b/src/Blessings.hs index 21cbabd..302b8bc 100644 --- a/src/Blessings.hs +++ b/src/Blessings.hs @@ -251,6 +251,14 @@ renderSGR pm = ("\ESC["<>) . (<>"m") . Bless.intercalate ";" . map Bless.fromInt $ pm +stripSGR :: Blessings a -> Blessings a +stripSGR = \case + Append t1 t2 -> Append (stripSGR t1) (stripSGR t2) + SGR _ t -> stripSGR t + Plain x -> Plain x + Empty -> Empty + + pp :: (Blessable a) => Blessings a -> a pp t = render emptyRenderState t "" |