@@ -78,15 +78,15 @@ tests =
7878 "A * symbol" =?>
7979 para (str "A" <> space <> str "*" <> space <> "symbol")
8080
81− , "Superscript single char" =:
82− "2^n" =?>
83− para (str "2" <> superscript "n")
81+ , "Superscript simple expression" =:
82+ "2^-λ" =?>
83+ para (str "2" <> superscript "-λ")
8484
8585 , "Superscript multi char" =:
8686 "2^{n-1}" =?>
8787 para (str "2" <> superscript "n-1")
8888
89− , "Subscript single char" =:
89+ , "Subscript simple expression" =:
9090 "a_n" =?>
9191 para (str "a" <> subscript "n")
9292
@@ -105,11 +105,8 @@ tests =
105105 ])
106106
107107 , "No empty markup" =:
108− -- FIXME: __ is erroneously parsed as subscript "_"
109− -- "// ** __ ++ == ~~ $$" =?>
110− -- para (spcSep [ "//", "**", "__", "++", "==", "~~", "$$" ])
111− "// ** ++ == ~~ $$" =?>
112− para (spcSep [ "//", "**", "++", "==", "~~", "$$" ])
108+ "// ** __ ++ == ~~ $$" =?>
109+ para (spcSep [ "//", "**", "__", "++", "==", "~~", "$$" ])
113110
114111 , "Adherence to Org's rules for markup borders" =:
115112 "/t/& a/ / ./r/ (*l*) /e/! /b/." =?>
@@ -143,6 +140,30 @@ tests =
143140 ]))
144141 , "emph/" ])
145142
143+ , "Sub- and superscript expressions" =:
144+ unlines [ "a_(a(b)(c)d)"
145+ , "e^(f(g)h)"
146+ , "i_(jk)l)"
147+ , "m^()n"
148+ , "o_{p{q{}r}}"
149+ , "s^{t{u}v}"
150+ , "w_{xy}z}"
151+ , "1^{}2"
152+ , "3_{{}}"
153+ , "4^(a(*b(c*)d))"
154+ ] =?>
155+ para (spcSep [ "a" <> subscript "(a(b)(c)d)"
156+ , "e" <> superscript "(f(g)h)"
157+ , "i" <> (subscript "(jk)") <> "l)"
158+ , "m" <> (superscript "()") <> "n"
159+ , "o" <> subscript "p{q{}r}"
160+ , "s" <> superscript "t{u}v"
161+ , "w" <> (subscript "xy") <> "z}"
162+ , "1" <> (superscript "") <> "2"
163+ , "3" <> subscript "{}"
164+ , "4" <> superscript ("(a(" <> strong "b(c" <> ")d))")
165+ ])
166+
146167 , "Image" =:
147168 "[[./sunset.jpg]]" =?>
148169 (para $ image "./sunset.jpg" "" "")