diff options
author | Craig S. Bosma <craig.bosma@gmail.com> | 2015-03-09 07:11:53 -0500 |
---|---|---|
committer | Craig S. Bosma <craig.bosma@gmail.com> | 2015-03-09 07:11:53 -0500 |
commit | 513221f822e7086b9841e59be23feb40b82f4977 (patch) | |
tree | a15361d2972981261e2fefb18f025ad15b63c77c /tests/Tests/Readers/Org.hs | |
parent | c7c45918dc5cc34fe47186c62027802bcd6b3b9a (diff) | |
download | pandoc-513221f822e7086b9841e59be23feb40b82f4977.tar.gz |
Org reader: add support for smart punctuation
Diffstat (limited to 'tests/Tests/Readers/Org.hs')
-rw-r--r-- | tests/Tests/Readers/Org.hs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs index 39c40cd45..c373d52cc 100644 --- a/tests/Tests/Readers/Org.hs +++ b/tests/Tests/Readers/Org.hs @@ -12,6 +12,9 @@ import Data.Monoid (mempty, mappend, mconcat) org :: String -> Pandoc org = readOrg def +orgSmart :: String -> Pandoc +orgSmart = readOrg def { readerSmart = True } + infix 4 =: (=:) :: ToString c => String -> (String, c) -> Test @@ -1152,4 +1155,25 @@ tests = ] in codeBlockWith ( "", classes, params) "code body\n" ] + , testGroup "Smart punctuation" + [ test orgSmart "quote before ellipses" + ("'...hi'" + =?> para (singleQuoted "…hi")) + + , test orgSmart "apostrophe before emph" + ("D'oh! A l'/aide/!" + =?> para ("D’oh! A l’" <> emph "aide" <> "!")) + + , test orgSmart "apostrophe in French" + ("À l'arrivée de la guerre, le thème de l'«impossibilité du socialisme»" + =?> para "À l’arrivée de la guerre, le thème de l’«impossibilité du socialisme»") + + , test orgSmart "Quotes cannot occur at the end of emphasized text" + ("/say \"yes\"/" =?> + para ("/say" <> space <> doubleQuoted "yes" <> "/")) + + , test orgSmart "Dashes are allowed at the borders of emphasis'" + ("/foo---/" =?> + para (emph "foo—")) + ] ] |