diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-03-07 03:01:43 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-03-07 03:01:43 +0000 |
commit | 42ade05ebe62b7995f87ea99fc10e78fedd8d349 (patch) | |
tree | ea2be00baa0ff1f5187eea521218394d3872d2db /src | |
parent | 402016df28cb8cffbba31d0e66c81d22520b2778 (diff) | |
download | pandoc-42ade05ebe62b7995f87ea99fc10e78fedd8d349.tar.gz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 8fd256c4f..691a1c7f2 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -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 '\'' |