@@ -166,10 +166,8 @@ double_quote = (doubleQuoted . mconcat) <$>
166166 (try $ string "``" *> manyTill inline (try $ string "''"))
167167
168168single_quote :: LP Inlines
169−single_quote = char '`' *>
170− ( try ((singleQuoted . mconcat) <$>
171− manyTill inline (try $ char '\'' >> notFollowedBy letter))
172− <|> lit "`")
169+single_quote = (singleQuoted . mconcat) <$>
170+ (try $ char '`' *> manyTill inline (try $ char '\'' >> notFollowedBy letter))
173171
174172inline :: LP Inlines
175173inline = (mempty <$ comment)
@@ -181,6 +179,9 @@ inline = (mempty <$ comment)
181179 ((char '-') *> option (str "–") (str "—" <$ char '-')))
182180 <|> double_quote
183181 <|> single_quote
182+ <|> (str "“" <$ try (string "``")) -- nb. {``} won't be caught by double_quote
183+ <|> (str "”" <$ try (string "''"))
184+ <|> (str "‘" <$ char '`') -- nb. {`} won't be caught by single_quote
184185 <|> (str "’" <$ char '\'')
185186 <|> (str "\160" <$ char '~')
186187 <|> (mathDisplay $ string "$$" *> mathChars <* string "$$")
@@ -188,10 +189,9 @@ inline = (mempty <$ comment)
188189 <|> (superscript <$> (char '^' *> tok))
189190 <|> (subscript <$> (char '_' *> tok))
190191 <|> (guardEnabled Ext_literate_haskell *> char '|' *> doLHSverb)
191− <|> (str <$> count 1 tildeEscape)
192− <|> (str <$> string "]")
193− <|> (str <$> string "#") -- TODO print warning?
194− <|> (str <$> string "&") -- TODO print warning?
192+ <|> (str . (:[]) <$> tildeEscape)
193+ <|> (str . (:[]) <$> oneOf "[]")
194+ <|> (str . (:[]) <$> oneOf "#&") -- TODO print warning?
195195 -- <|> (str <$> count 1 (satisfy (\c -> c /= '\\' && c /='\n' && c /='}' && c /='{'))) -- eat random leftover characters
196196
197197inlines :: LP Inlines
@@ -645,11 +645,7 @@ inlineText :: LP Inlines
645645inlineText = str <$> many1 inlineChar
646646
647647inlineChar :: LP Char
648−inlineChar = satisfy $ \c ->
649− not (c == '\\' || c == '$' || c == '%' || c == '^' || c == '_' ||
650− c == '&' || c == '~' || c == '#' || c == '{' || c == '}' ||
651− c == '^' || c == '\'' || c == '`' || c == '-' || c == ']' ||
652− c == ' ' || c == '\t' || c == '\n' )
648+inlineChar = noneOf "\\$%^_&~#{}^'`-[] \t\n"
653649
654650environment :: LP Blocks
655651environment = do