summaryrefslogtreecommitdiff
path: root/tests/Tests
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2015-11-13 20:32:36 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2015-11-13 20:43:46 +0100
commit220f3d12b804a8baa188e9c7174707d3cb0316e1 (patch)
treebf13da0f8ca6ef0717048cae533bcb91a12b2d79 /tests/Tests
parenta119ad8d09393c8a168e76aeefcde6ba6417a94b (diff)
Org reader: Fix emphasis rules for smart parsing
Smart quotes, ellipses, and dashes should behave like normal quotes, single dashes, and dots with respect to text markup parsing. The parser state was not updated properly in all cases, which has been fixed. Thanks to @conklech for reporting this issue. This fixes #2513.
Diffstat (limited to 'tests/Tests')
-rw-r--r--tests/Tests/Readers/Org.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index 05d206d85..02d2fb696 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -1246,6 +1246,7 @@ tests =
]
in codeBlockWith ( "", classes, params) "code body\n"
]
+
, testGroup "Smart punctuation"
[ test orgSmart "quote before ellipses"
("'...hi'"
@@ -1266,5 +1267,13 @@ tests =
, test orgSmart "Dashes are allowed at the borders of emphasis'"
("/foo---/" =?>
para (emph "foo—"))
+
+ , test orgSmart "Single quotes can be followed by emphasized text"
+ ("Singles on the '/meat market/'" =?>
+ para ("Singles on the " <> (singleQuoted $ emph "meat market")))
+
+ , test orgSmart "Double quotes can be followed by emphasized text"
+ ("Double income, no kids: \"/DINK/\"" =?>
+ para ("Double income, no kids: " <> (doubleQuoted $ emph "DINK")))
]
]