Render ReferenceLinkDefinition
parent
8aa18bfcf7
commit
d465f223ef
|
@ -96,7 +96,7 @@ data BlockPiece = Paragraph Inline
|
|||
| BlockQuote Block
|
||||
| CodeBlock Text Text
|
||||
| Heading Int Inline
|
||||
| ReferenceLinkDefinition { label :: Text, dest :: Text, title :: Text }
|
||||
| ReferenceLinkDefinition { label, dest, title :: Text }
|
||||
| List ListType ListSpacing [Block]
|
||||
deriving stock (Show)
|
||||
|
||||
|
@ -197,7 +197,12 @@ instance PrintColor Block where
|
|||
for_ (zip (listPrefixes type_) blocks) \(listPrefix, block) -> do
|
||||
printBlockP (prefix <> listPrefix) block
|
||||
putTextLnO ""
|
||||
printBlockOne _prefix x = error $ "printBlockOne: " <> show x
|
||||
printBlockOne prefix ReferenceLinkDefinition{label, dest, title} = do
|
||||
putTextO prefix
|
||||
putTextO $ "[" <> label <> "]: "
|
||||
withSgr [ANSI.SetUnderlining ANSI.SingleUnderline] do
|
||||
putTextO dest
|
||||
putTextLnO $ " " <> title
|
||||
|
||||
listPrefixes :: ListType -> [Text]
|
||||
listPrefixes (BulletList c) = repeat (fromString [c, ' '])
|
||||
|
|
Loading…
Reference in New Issue