Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion elm-format-markdown/Cheapskate/Parse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,9 @@ processElts refmap (L _lineNumber lf : rest) =
TextLine t | Just terms1 <- T.stripPrefix "@docs" t ->
let
docs = terms1 : map (cleanDoc . extractText) docLines
cleaned = filter ((/=) []) $ fmap (filter ((/=) "") . fmap T.strip . T.splitOn ",") docs
in
singleton (ElmDocs $ filter ((/=) []) $ fmap (filter ((/=) ""). fmap T.strip . T.splitOn ",") docs) <>
(if null cleaned then mempty else singleton (ElmDocs cleaned)) <>
processElts refmap rest'
where
(docLines, rest') = span isDocLine rest
Expand Down
13 changes: 13 additions & 0 deletions tests/test-files/transform/Elm-0.19/RemoveEmptyElmDocsProperly.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module A exposing (a)

{-|

@docs

@docs a

-}


a =
1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module A exposing (a)

{-|

@docs a

-}


a =
1