@@ -596,32 +596,28 @@ ungroupedSimpleInline :: Parser [Char] ParserState t -- ^ surrounding
596596ungroupedSimpleInline border construct = try $ do
597597 st <- getState
598598 pos <- getPosition
599− isWhitespace <- option False (whitespace >> return True)
600− guard $ (stateQuoteContext st /= NoQuote)
601− || (sourceColumn pos == 1)
602− || isWhitespace
599+ let afterString = stateLastStrPos st == Just pos
600+ guard $ not afterString
603601 border *> notFollowedBy (oneOf " \t\n\r")
604602 attr <- attributes
605603 body <- trimInlines . mconcat <$>
606604 withQuoteContext InSingleQuote
607605 (manyTill inline (try border <* notFollowedBy alphaNum))
608− let result = construct $
606+ return $ construct $
609607 if attr == nullAttr
610608 then body
611609 else B.spanWith attr body
612− return $ if isWhitespace
613− then B.space <> result
614− else result
615610
616611groupedSimpleInline :: Parser [Char] ParserState t
617612 -> (Inlines -> Inlines)
618613 -> Parser [Char] ParserState Inlines
619614groupedSimpleInline border construct = try $ do
620615 char '['
621− withQuoteContext InSingleQuote (simpleInline border construct) >>~ char ']'
622−
623−
624−
616+ sp1 <- option mempty $ B.space <$ whitespace
617+ result <- withQuoteContext InSingleQuote (simpleInline border construct)
618+ sp2 <- option mempty $ B.space <$ whitespace
619+ char ']'
620+ return $ sp1 <> result <> sp2
625621
626622-- | Create a singleton list
627623singleton :: a -> [a]