aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-08-19 11:12:18 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2012-08-19 11:15:32 -0700
commit7b34dd8dd1cf991807c84fc2900e19869885995d (patch)
treeb205f0ac9fae0d0bd5b39a08f052c23114b1c459 /src/Text/Pandoc/Readers
parent5d3b2955681d84458537e3bea7b004262960d374 (diff)
downloadpandoc-7b34dd8dd1cf991807c84fc2900e19869885995d.tar.gz
Added Ext_abbrevations for PHP markdown style abbreviation keys.
Note: pandoc does not have an abbreviation element (yet) and so currently when this extension is enabled, it just causes pandoc to skip the abbrevation keys.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index b0925ac68..792c0269a 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -219,10 +219,6 @@ parseMarkdown = do
$ B.setDate (runF date st)
$ B.doc $ runF blocks st
---
--- initial pass for references and notes
---
-
referenceKey :: Parser [Char] ParserState (F Blocks)
referenceKey = try $ do
skipNonindentSpaces
@@ -256,6 +252,20 @@ referenceTitle = try $ do
notFollowedBy (noneOf ")\n")))
return $ fromEntities tit
+-- | PHP Markdown Extra style abbreviation key. Currently
+-- we just skip them, since Pandoc doesn't have an element for
+-- an abbreviation.
+abbrevKey :: Parser [Char] ParserState (F Blocks)
+abbrevKey = do
+ guardEnabled Ext_abbreviations
+ try $ do
+ char '*'
+ reference
+ char ':'
+ skipMany (satisfy (/= '\n'))
+ blanklines
+ return $ return mempty
+
noteMarker :: Parser [Char] ParserState String
noteMarker = string "[^" >> many1Till (satisfy $ not . isBlank) (char ']')
@@ -311,6 +321,7 @@ block = choice [ codeBlockDelimited
, definitionList
, noteBlock
, referenceKey
+ , abbrevKey
, para
, plain
] <?> "block"