44
43
"`*` {.haskell .special x=\"7\"}"
45
44
=?> para (codeWith ("",["haskell","special"],[("x","7")]) "*")
46
, testGroup "backslash escapes"
49
=?> para (link "/there)" "" "hi")
51
"[hi](/there \"a\\\"a\")"
52
=?> para (link "/there" "a\"a" "hi")
53
, "in reference link title" =:
54
"[hi]\n\n[hi]: /there (a\\)a)"
55
=?> para (link "/there" "a)a" "hi")
56
, "in reference link URL" =:
57
"[hi]\n\n[hi]: /there\\.0"
58
=?> para (link "/there.0" "" "hi")
47
60
, testGroup "smart punctuation"
48
61
[ test markdownSmart "quote before ellipses"
50
=?> para (singleQuoted (singleton Ellipses +++ "hi")))
63
=?> para (singleQuoted ("…hi")))
64
, test markdownSmart "apostrophe before emph"
66
=?> para ("D’oh! A l’" <> emph "aide" <> "!"))
67
, test markdownSmart "apostrophe in French"
68
("À l'arrivée de la guerre, le thème de l'«impossibilité du socialisme»"
69
=?> para ("À l’arrivée de la guerre, le thème de l’«impossibilité du socialisme»"))
52
71
, testGroup "mixed emphasis and strong"
53
72
[ "emph and strong emph alternating" =:
54
73
"*xxx* ***xxx*** xxx\n*xxx* ***xxx*** xxx"
55
=?> para (emph "xxx" +++ space +++ strong (emph "xxx") +++
56
space +++ "xxx" +++ space +++
57
emph "xxx" +++ space +++ strong (emph "xxx") +++
74
=?> para (emph "xxx" <> space <> strong (emph "xxx") <>
75
space <> "xxx" <> space <>
76
emph "xxx" <> space <> strong (emph "xxx") <>
59
78
, "emph with spaced strong" =:
61
=?> para (emph ("x" +++ space +++ strong "xx" +++ space +++ "x"))
80
=?> para (emph ("x" <> space <> strong "xx" <> space <> "x"))
63
82
, testGroup "footnotes"
64
83
[ "indent followed by newline and flush-left text" =:
65
84
"[^1]\n\n[^1]: my note\n\n \nnot in note\n"
66
=?> para (note (para "my note")) +++ para "not in note"
85
=?> para (note (para "my note")) <> para "not in note"
67
86
, "indent followed by newline and indented text" =:
68
87
"[^1]\n\n[^1]: my note\n \n in note\n"
69
=?> para (note (para "my note" +++ para "in note"))
88
=?> para (note (para "my note" <> para "in note"))
70
89
, "recursive note" =:
71
90
"[^1]\n\n[^1]: See [^1]\n"
72
91
=?> para (note (para "See [^1]"))
76
95
"inverse bird tracks and html" $
77
96
"> a\n\n< b\n\n<div>\n"
78
97
=?> codeBlockWith ("",["sourceCode","literate","haskell"],[]) "a"
80
99
codeBlockWith ("",["sourceCode","haskell"],[]) "b"
82
101
rawBlock "html" "<div>\n\n"
84
103
-- the round-trip properties frequently fail