Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #454, Remove (..) from types in @docs #565

Merged
merged 1 commit into from
Oct 8, 2018
Merged
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
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