@@ -603,6 +603,7 @@ data ParserState = ParserState
603 { stateParseRaw :: Bool, -- ^ Parse raw HTML and LaTeX?
603 { stateParseRaw :: Bool, -- ^ Parse raw HTML and LaTeX?
604 stateParserContext :: ParserContext, -- ^ Inside list?
604 stateParserContext :: ParserContext, -- ^ Inside list?
605 stateQuoteContext :: QuoteContext, -- ^ Inside quoted environment?
605 stateQuoteContext :: QuoteContext, -- ^ Inside quoted environment?
606+ stateLastStrPos :: Maybe SourcePos, -- ^ Position after last str parsed
606 stateKeys :: KeyTable, -- ^ List of reference keys
607 stateKeys :: KeyTable, -- ^ List of reference keys
607 stateCitations :: [String], -- ^ List of available citations
608 stateCitations :: [String], -- ^ List of available citations
608 stateNotes :: NoteTable, -- ^ List of notes
609 stateNotes :: NoteTable, -- ^ List of notes
@@ -630,6 +631,7 @@ defaultParserState =
630 ParserState { stateParseRaw = False,
631 ParserState { stateParseRaw = False,
631 stateParserContext = NullState,
632 stateParserContext = NullState,
632 stateQuoteContext = NoQuote,
633 stateQuoteContext = NoQuote,
634+ stateLastStrPos = Nothing,
633 stateKeys = M.empty,
635 stateKeys = M.empty,
634 stateCitations = [],
636 stateCitations = [],
635 stateNotes = [],
637 stateNotes = [],
@@ -751,8 +753,12 @@ charOrRef cs =
751 return c)
753 return c)
753singleQuoteStart :: GenParser Char ParserState ()
755singleQuoteStart :: GenParser Char ParserState ()
754−singleQuoteStart = do
756+singleQuoteStart = do
755 failIfInQuoteContext InSingleQuote
757 failIfInQuoteContext InSingleQuote
760+ -- single quote start can't be right after str
761+ guard $ stateLastStrPos st /= Just pos
756 try $ do charOrRef "'\8216\145"
762 try $ do charOrRef "'\8216\145"
757 notFollowedBy (oneOf ")!],;:-? \t\n")
763 notFollowedBy (oneOf ")!],;:-? \t\n")
758 notFollowedBy (char '.') <|> lookAhead (string "..." >> return ())
764 notFollowedBy (char '.') <|> lookAhead (string "..." >> return ())