@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 Module : Text.Pandoc.Readers.Org
23 Module : Text.Pandoc.Readers.Org
24− Copyright : Copyright (C) 2014 Albert Krewinkel
24+ Copyright : Copyright (C) 2014-2015 Albert Krewinkel
25 License : GNU GPL, version 2 or above
25 License : GNU GPL, version 2 or above
27 Maintainer : Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
27 Maintainer : Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
@@ -1585,8 +1585,11 @@ smart :: OrgParser (F Inlines)
1585smart = do
1585smart = do
1586 getOption readerSmart >>= guard
1586 getOption readerSmart >>= guard
1587 doubleQuoted <|> singleQuoted <|>
1587 doubleQuoted <|> singleQuoted <|>
1588− choice (map (return <$>) [orgApostrophe, dash, ellipses])
1588+ choice (map (return <$>) [orgApostrophe, orgDash, orgEllipses])
1590+ orgDash = dash <* updatePositions '-'
1591+ orgEllipses = ellipses <* updatePositions '.'
1589− where orgApostrophe =
1592+ orgApostrophe =
1590 (char '\'' <|> char '\8217') <* updateLastPreCharPos
1593 (char '\'' <|> char '\8217') <* updateLastPreCharPos
1591 <* updateLastForbiddenCharPos
1594 <* updateLastForbiddenCharPos
1592 *> return (B.str "\x2019")
1595 *> return (B.str "\x2019")
@@ -1594,9 +1597,10 @@ smart = do
1594singleQuoted :: OrgParser (F Inlines)
1597singleQuoted :: OrgParser (F Inlines)
1595singleQuoted = try $ do
1598singleQuoted = try $ do
1596 singleQuoteStart
1599 singleQuoteStart
1600+ updatePositions '\''
1597 withQuoteContext InSingleQuote $
1601 withQuoteContext InSingleQuote $
1598 fmap B.singleQuoted . trimInlinesF . mconcat <$>
1602 fmap B.singleQuoted . trimInlinesF . mconcat <$>
1599− many1Till inline singleQuoteEnd
1603+ many1Till inline (singleQuoteEnd <* updatePositions '\'')
1601-- doubleQuoted will handle regular double-quoted sections, as well
1605-- doubleQuoted will handle regular double-quoted sections, as well
1602-- as dialogues with an open double-quote without a close double-quote
1606-- as dialogues with an open double-quote without a close double-quote
@@ -1604,6 +1608,7 @@ singleQuoted = try $ do
1604doubleQuoted :: OrgParser (F Inlines)
1608doubleQuoted :: OrgParser (F Inlines)
1605doubleQuoted = try $ do
1609doubleQuoted = try $ do
1606 doubleQuoteStart
1610 doubleQuoteStart
1611+ updatePositions '"'
1607 contents <- mconcat <$> many (try $ notFollowedBy doubleQuoteEnd >> inline)
1612 contents <- mconcat <$> many (try $ notFollowedBy doubleQuoteEnd >> inline)
1608 (withQuoteContext InDoubleQuote $ (doubleQuoteEnd <* updateLastForbiddenCharPos) >> return
1613 (withQuoteContext InDoubleQuote $ (doubleQuoteEnd <* updateLastForbiddenCharPos) >> return
1609 (fmap B.doubleQuoted . trimInlinesF $ contents))
1614 (fmap B.doubleQuoted . trimInlinesF $ contents))