diff --git a/hspec-core.cabal b/hspec-core.cabal
--- a/hspec-core.cabal
+++ b/hspec-core.cabal
@@ -5,7 +5,7 @@
 -- see: https://github.com/sol/hpack
 
 name:             hspec-core
-version:          2.10.3
+version:          2.10.4
 license:          MIT
 license-file:     LICENSE
 copyright:        (c) 2011-2022 Simon Hengel,
diff --git a/src/Test/Hspec/Core/Formatters/Internal.hs b/src/Test/Hspec/Core/Formatters/Internal.hs
--- a/src/Test/Hspec/Core/Formatters/Internal.hs
+++ b/src/Test/Hspec/Core/Formatters/Internal.hs
@@ -243,13 +243,14 @@
 writeChunk :: String -> FormatM ()
 writeChunk str = do
   h <- getHandle
+  let
+    plainOutput = IO.hPutStr h str
+    colorOutput color = bracket_ (hSetSGR h [color]) (hSetSGR h [Reset]) plainOutput
   mColor <- gets stateColor
   liftIO $ case mColor of
-    Just color | not (all isSpace str) -> bracket_
-      (hSetSGR h [color])
-      (hSetSGR h [Reset])
-      (IO.hPutStr h str)
-    _ -> IO.hPutStr h str
+    Just (SetColor Foreground _ _) | all isSpace str -> plainOutput
+    Just color -> colorOutput color
+    Nothing -> plainOutput
 
 -- | Set output color to red, run given action, and finally restore the default
 -- color.
diff --git a/test/Test/Hspec/Core/Formatters/InternalSpec.hs b/test/Test/Hspec/Core/Formatters/InternalSpec.hs
--- a/test/Test/Hspec/Core/Formatters/InternalSpec.hs
+++ b/test/Test/Hspec/Core/Formatters/InternalSpec.hs
@@ -13,7 +13,7 @@
   formatConfigUseColor = True
 , formatConfigReportProgress = False
 , formatConfigOutputUnicode = False
-, formatConfigUseDiff = False
+, formatConfigUseDiff = True
 , formatConfigPrettyPrint = False
 , formatConfigPrettyPrintFunction = Nothing
 , formatConfigPrintTimes = False
@@ -28,8 +28,37 @@
 
 spec :: Spec
 spec = do
+  forM_ [
+      ("extraChunk", extraChunk, Red)
+    , ("missingChunk", missingChunk, Green)
+    ] $ \ (name, chunk, color) -> do
+
+    let colorize layer text = setSGRCode [SetColor layer Dull color] <> text <> setSGRCode [Reset]
+
+    describe name $ do
+      it "colorizes chunks" $ do
+        capture_ $ runFormatM formatConfig $ do
+          chunk "foo"
+        `shouldReturn` colorize Foreground "foo"
+
+      context "with an all-spaces chunk" $ do
+        it "colorizes background" $ do
+          capture_ $ runFormatM formatConfig $ do
+            chunk "  "
+          `shouldReturn` colorize Background "  "
+
+      context "with an all-newlines chunk" $ do
+        it "colorizes background" $ do
+          capture_ $ runFormatM formatConfig $ do
+            chunk "\n\n\n"
+          `shouldReturn` colorize Background "\n\n\n"
+
   describe "write" $ do
     it "does not span colored output over multiple lines" $ do
+
+      -- This helps with output on Jenkins and Buildkite:
+      -- https://github.com/hspec/hspec/issues/346
+
       capture_ $ runFormatM formatConfig $ do
         withSuccessColor $ write "foo\nbar\nbaz\n"
       `shouldReturn` unlines [green "foo", green "bar", green "baz"]
diff --git a/version.yaml b/version.yaml
--- a/version.yaml
+++ b/version.yaml
@@ -1,1 +1,1 @@
-&version 2.10.3
+&version 2.10.4
