@@ -603,6 +603,7 @@ data ParserState = ParserState
603603 { stateParseRaw :: Bool, -- ^ Parse raw HTML and LaTeX?
604604 stateParserContext :: ParserContext, -- ^ Inside list?
605605 stateQuoteContext :: QuoteContext, -- ^ Inside quoted environment?
606+ stateLastStrPos :: Maybe SourcePos, -- ^ Position after last str parsed
606607 stateKeys :: KeyTable, -- ^ List of reference keys
607608 stateCitations :: [String], -- ^ List of available citations
608609 stateNotes :: NoteTable, -- ^ List of notes
@@ -630,6 +631,7 @@ defaultParserState =
630631 ParserState { stateParseRaw = False,
631632 stateParserContext = NullState,
632633 stateQuoteContext = NoQuote,
634+ stateLastStrPos = Nothing,
633635 stateKeys = M.empty,
634636 stateCitations = [],
635637 stateNotes = [],
@@ -751,8 +753,12 @@ charOrRef cs =
751753 return c)
752754
753755singleQuoteStart :: GenParser Char ParserState ()
754−singleQuoteStart = do
756+singleQuoteStart = do
755757 failIfInQuoteContext InSingleQuote
758+ pos <- getPosition
759+ st <- getState
760+ -- single quote start can't be right after str
761+ guard $ stateLastStrPos st /= Just pos
756762 try $ do charOrRef "'\8216\145"
757763 notFollowedBy (oneOf ")!],;:-? \t\n")
758764 notFollowedBy (char '.') <|> lookAhead (string "..." >> return ())