@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2121
2222{- |
2323 Module : Text.Pandoc.Readers.Org
24− Copyright : Copyright (C) 2014 Albert Krewinkel
24+ Copyright : Copyright (C) 2014-2015 Albert Krewinkel
2525 License : GNU GPL, version 2 or above
2626
2727 Maintainer : Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
@@ -1585,8 +1585,11 @@ smart :: OrgParser (F Inlines)
15851585smart = do
15861586 getOption readerSmart >>= guard
15871587 doubleQuoted <|> singleQuoted <|>
1588− choice (map (return <$>) [orgApostrophe, dash, ellipses])
1589− where orgApostrophe =
1588+ choice (map (return <$>) [orgApostrophe, orgDash, orgEllipses])
1589+ where
1590+ orgDash = dash <* updatePositions '-'
1591+ orgEllipses = ellipses <* updatePositions '.'
1592+ orgApostrophe =
15901593 (char '\'' <|> char '\8217') <* updateLastPreCharPos
15911594 <* updateLastForbiddenCharPos
15921595 *> return (B.str "\x2019")
@@ -1594,9 +1597,10 @@ smart = do
15941597singleQuoted :: OrgParser (F Inlines)
15951598singleQuoted = try $ do
15961599 singleQuoteStart
1600+ updatePositions '\''
15971601 withQuoteContext InSingleQuote $
15981602 fmap B.singleQuoted . trimInlinesF . mconcat <$>
1599− many1Till inline singleQuoteEnd
1603+ many1Till inline (singleQuoteEnd <* updatePositions '\'')
16001604
16011605-- doubleQuoted will handle regular double-quoted sections, as well
16021606-- as dialogues with an open double-quote without a close double-quote
@@ -1604,6 +1608,7 @@ singleQuoted = try $ do
16041608doubleQuoted :: OrgParser (F Inlines)
16051609doubleQuoted = try $ do
16061610 doubleQuoteStart
1611+ updatePositions '"'
16071612 contents <- mconcat <$> many (try $ notFollowedBy doubleQuoteEnd >> inline)
16081613 (withQuoteContext InDoubleQuote $ (doubleQuoteEnd <* updateLastForbiddenCharPos) >> return
16091614 (fmap B.doubleQuoted . trimInlinesF $ contents))