@@ -76,7 +76,10 @@ keyToRST :: WriterOptions
7676 -> State WriterState Doc
7777keyToRST opts (label, (src, tit)) = do
7878 label' <- inlineListToRST opts label
79− return $ text ".. _" <> label' <> text ": " <> text src
79+ let label'' = if ':' `elem` (render label')
80+ then char '`' <> label' <> char '`'
81+ else label'
82+ return $ text ".. _" <> label'' <> text ": " <> text src
8083
8184-- | Return RST representation of notes.
8285notesToRST :: WriterOptions -> [[Block]] -> State WriterState Doc