diff --git a/cabal-gild.cabal b/cabal-gild.cabal
--- a/cabal-gild.cabal
+++ b/cabal-gild.cabal
@@ -11,7 +11,7 @@
 maintainer: Taylor Fausak
 name: cabal-gild
 synopsis: Formats package descriptions.
-version: 1.1.0.0
+version: 1.1.0.1
 
 source-repository head
   type: git
diff --git a/source/library/CabalGild/Action/Render.hs b/source/library/CabalGild/Action/Render.hs
--- a/source/library/CabalGild/Action/Render.hs
+++ b/source/library/CabalGild/Action/Render.hs
@@ -59,8 +59,8 @@
               }
           <> fieldLines (i + 1) fls
   Fields.Section n sas fs ->
-    Lens.set Block.lineBeforeLens True
-      . Lens.set Block.lineAfterLens True
+    Lens.set Block.lineBeforeLens (not $ Name.isElif n || Name.isElse n)
+      . Lens.set Block.lineAfterLens (not $ Name.isIf n || Name.isElif n)
       $ comments i (Name.annotation n)
         <> comments i (concatMap SectionArg.annotation sas)
         <> Block.fromLine
diff --git a/source/library/CabalGild/Extra/Name.hs b/source/library/CabalGild/Extra/Name.hs
--- a/source/library/CabalGild/Extra/Name.hs
+++ b/source/library/CabalGild/Extra/Name.hs
@@ -1,5 +1,6 @@
 module CabalGild.Extra.Name where
 
+import qualified CabalGild.Extra.String as String
 import qualified Distribution.Compat.Lens as Lens
 import qualified Distribution.Fields as Fields
 
@@ -14,3 +15,15 @@
 -- | Extracts the value from the given 'Fields.Name'.
 value :: Fields.Name a -> Fields.FieldName
 value (Fields.Name _ x) = x
+
+-- | Returns true when the name is @"if"@, false otherwise.
+isIf :: Fields.Name a -> Bool
+isIf = (== String.toUtf8 "if") . value
+
+-- | Returns true when the name is @"elif"@, false otherwise.
+isElif :: Fields.Name a -> Bool
+isElif = (== String.toUtf8 "elif") . value
+
+-- | Returns true when the name is @"else"@, false otherwise.
+isElse :: Fields.Name a -> Bool
+isElse = (== String.toUtf8 "else") . value
diff --git a/source/test-suite/Main.hs b/source/test-suite/Main.hs
--- a/source/test-suite/Main.hs
+++ b/source/test-suite/Main.hs
@@ -970,6 +970,31 @@
       "s{t{}}"
       "s\n  t\n"
 
+  Hspec.it "groups 'else' with 'if'" $ do
+    expectGilded
+      "if p\n a\nelse\n b"
+      "if p\n  a\nelse\n  b\n"
+
+  Hspec.it "groups 'elif' with 'if'" $ do
+    expectGilded
+      "if p\n a\nelif q\n b"
+      "if p\n  a\nelif q\n  b\n"
+
+  Hspec.it "groups 'else' with 'elif'" $ do
+    expectGilded
+      "if p\n a\nelif q\n b\nelse\n c"
+      "if p\n  a\nelif q\n  b\nelse\n  c\n"
+
+  Hspec.it "does not group 'else' with anything else" $ do
+    expectGilded
+      "library\nelse p\n a"
+      "library\n\nelse p\n  a\n"
+
+  Hspec.it "does not group 'elif' with anything else" $ do
+    expectGilded
+      "library\nelif p\n a"
+      "library\n\nelif p\n  a\n"
+
 expectGilded :: (Stack.HasCallStack) => String -> String -> Hspec.Expectation
 expectGilded input expected = do
   let (a, s, w) =
