mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-25 01:36:45 +00:00
Smart quote parsing in Markdown reader:
treat ' followed by ll, re, ve, then a non-letter, as a contraction. (e.g. I've, you're, he'll) git-svn-id: https://pandoc.googlecode.com/svn/trunk@559 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
@@ -32,7 +32,7 @@ module Text.Pandoc.Readers.Markdown (
|
||||
) where
|
||||
|
||||
import Data.List ( findIndex, sortBy, transpose, isSuffixOf, intersect )
|
||||
import Data.Char ( isAlphaNum )
|
||||
import Data.Char ( isAlphaNum, toUpper )
|
||||
import Text.ParserCombinators.Pandoc
|
||||
import Text.Pandoc.Definition
|
||||
import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXEnvironment )
|
||||
@@ -778,7 +778,9 @@ singleQuoteStart = try $ do
|
||||
char '\''
|
||||
notFollowedBy (oneOf ")!],.;:-? \t\n")
|
||||
notFollowedBy (try (do -- possessive or contraction
|
||||
oneOf "sStT"
|
||||
let endings = ["s","t","ve","ll","re"]
|
||||
oneOfStrings (endings ++
|
||||
map (map toUpper) endings)
|
||||
satisfy (not . isAlphaNum)))
|
||||
return '\''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user