Skip to content

Commit

Permalink
Merge pull request avh4#565 from mdevlamynck/pr-remove-illegal-wildca…
Browse files Browse the repository at this point in the history
…rd-docs

Fix avh4#454, Remove (..) from types in @docs
  • Loading branch information
avh4 authored Oct 8, 2018
2 parents c3be615 + 52cfeae commit 479705d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/ElmFormat/Render/Box.hs
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,18 @@ formatModuleDocs elmVersion importInfo blocks =

content :: String
content =
ElmFormat.Render.Markdown.formatMarkdown (fmap format . parse) blocks
ElmFormat.Render.Markdown.formatMarkdown (fmap format . parse) $ fmap cleanBlock blocks

cleanBlock :: Markdown.Block -> Markdown.Block
cleanBlock block =
case block of
Markdown.ElmDocs docs ->
Markdown.ElmDocs $
(fmap . fmap)
(Text.replace (Text.pack "(..)") (Text.pack ""))
docs
_ ->
block
in
formatDocComment content

Expand Down
3 changes: 2 additions & 1 deletion tests/test-files/transform/DocCommentAtDocs.elm
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module DocCommentAtDocs exposing (x, y, z)
module DocCommentAtDocs exposing (x, y, z, T(..))

{-|
@docs
x,
y,
z
@docs T(..)
@docs a , b , c
@docs d
Expand Down
2 changes: 2 additions & 0 deletions tests/test-files/transform/DocCommentAtDocs.formatted.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ module DocCommentAtDocs exposing
( x
, y
, z
, T(..)
)

{-|
@docs x
@docs y
@docs z
@docs T
@docs a, b, c
@docs d
Expand Down

0 comments on commit 479705d

Please sign in to comment.