RST writer: If label for a link reference contains a colon,

surround by ` signs so the colon won't be interpreted as the
end of the link label.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1029 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher
2007-09-19 01:15:20 +00:00
parent 2b429e980e
commit d9dedf0813
+4 -1
View File
@@ -76,7 +76,10 @@ keyToRST :: WriterOptions
-> State WriterState Doc
keyToRST opts (label, (src, tit)) = do
label' <- inlineListToRST opts label
return $ text ".. _" <> label' <> text ": " <> text src
let label'' = if ':' `elem` (render label')
then char '`' <> label' <> char '`'
else label'
return $ text ".. _" <> label'' <> text ": " <> text src
-- | Return RST representation of notes.
notesToRST :: WriterOptions -> [[Block]] -> State WriterState Doc