aboutsummaryrefslogtreecommitdiff
path: root/src/Tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-07-25 23:49:45 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2011-07-25 23:49:45 -0700
commit0f0c1579f870248566abe806ff7bb6cc866ab4dc (patch)
treec48d04e419356dd0fffaa7aba6b41342f94ca801 /src/Tests
parent499d1257ca75616a83a2d3bd106c3f9ffbbd2452 (diff)
downloadpandoc-0f0c1579f870248566abe806ff7bb6cc866ab4dc.tar.gz
Smart quotes: handle '...hi' properly.
Also added test case.
Diffstat (limited to 'src/Tests')
-rw-r--r--src/Tests/Readers/Markdown.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Tests/Readers/Markdown.hs b/src/Tests/Readers/Markdown.hs
index c0eb672ca..941762bd0 100644
--- a/src/Tests/Readers/Markdown.hs
+++ b/src/Tests/Readers/Markdown.hs
@@ -8,10 +8,14 @@ import Tests.Arbitrary()
import Text.Pandoc.Builder
-- import Text.Pandoc.Shared ( normalize )
import Text.Pandoc
+import Data.Sequence (singleton)
markdown :: String -> Pandoc
markdown = readMarkdown defaultParserState{ stateStandalone = True }
+markdownSmart :: String -> Pandoc
+markdownSmart = readMarkdown defaultParserState{ stateSmart = True }
+
infix 5 =:
(=:) :: ToString c
=> String -> (String, c) -> Test
@@ -40,6 +44,11 @@ tests = [ testGroup "inline code"
"`*` {.haskell .special x=\"7\"}"
=?> para (codeWith ("",["haskell","special"],[("x","7")]) "*")
]
+ , testGroup "smart punctuation"
+ [ test markdownSmart "quote before ellipses"
+ ("'...hi'"
+ =?> para (singleQuoted (singleton Ellipses +++ "hi")))
+ ]
, testGroup "mixed emphasis and strong"
[ "emph and strong emph alternating" =:
"*xxx* ***xxx*** xxx\n*xxx* ***xxx*** xxx"