Skip to content

Commit d2b7642

Browse files
committed
Add comments about inserting a new line in Markdown
1 parent 55eaebc commit d2b7642

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ghcide/src/Development/IDE/Spans/Common.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ safeTyThingId _ = Nothing
5151
-- Possible documentation for an element in the code
5252
data SpanDoc
5353
= SpanDocString HsDocString SpanDocUris
54-
-- ^ Extern module doc
5554
| SpanDocText [T.Text] SpanDocUris
56-
-- ^ Local module doc
5755
deriving stock (Eq, Show, Generic)
5856
deriving anyclass NFData
5957

@@ -80,6 +78,11 @@ emptySpanDoc = SpanDocText [] (SpanDocUris Nothing Nothing)
8078
-- it will result "xxxx---\nyyyy" and can't be rendered as a normal doc.
8179
-- Therefore we check every item in the value to make sure they all end with '\\n',
8280
-- this makes "xxxx\n---\nyyy\n" and can be rendered correctly.
81+
--
82+
-- Notes:
83+
--
84+
-- To insert a new line in Markdown, we need two '\\n', like ("\\n\\n"), __or__ a section
85+
-- symbol with one '\\n', like ("***\\n").
8386
spanDocToMarkdown :: SpanDoc -> [T.Text]
8487
spanDocToMarkdown = \case
8588
(SpanDocString docs uris) ->

0 commit comments

Comments
 (0)