@@ -23,48 +23,48 @@ import qualified Data.Text as T
2323tests :: [TestTree]
2424tests =
2525 [ "Source block" =:
26− T.unlines [ " #+BEGIN_SRC haskell"
26+ T.unlines [ " #+begin_src haskell"
2727 , " main = putStrLn greeting"
2828 , " where greeting = \"moin\""
29− , " #+END_SRC" ] =?>
29+ , " #+end_src" ] =?>
3030 let attr' = ("", ["haskell"], [])
3131 code' = "main = putStrLn greeting\n" <>
3232 " where greeting = \"moin\"\n"
3333 in codeBlockWith attr' code'
3434
3535 , "Source block with indented code" =:
36− T.unlines [ " #+BEGIN_SRC haskell"
36+ T.unlines [ " #+begin_src haskell"
3737 , " main = putStrLn greeting"
3838 , " where greeting = \"moin\""
39− , " #+END_SRC" ] =?>
39+ , " #+end_src" ] =?>
4040 let attr' = ("", ["haskell"], [])
4141 code' = "main = putStrLn greeting\n" <>
4242 " where greeting = \"moin\"\n"
4343 in codeBlockWith attr' code'
4444
4545 , "Source block with tab-indented code" =:
46− T.unlines [ "\t#+BEGIN_SRC haskell"
46+ T.unlines [ "\t#+begin_src haskell"
4747 , "\tmain = putStrLn greeting"
4848 , "\t where greeting = \"moin\""
49− , "\t#+END_SRC" ] =?>
49+ , "\t#+end_src" ] =?>
5050 let attr' = ("", ["haskell"], [])
5151 code' = "main = putStrLn greeting\n" <>
5252 " where greeting = \"moin\"\n"
5353 in codeBlockWith attr' code'
5454
5555 , "Empty source block" =:
56− T.unlines [ " #+BEGIN_SRC haskell"
57− , " #+END_SRC" ] =?>
56+ T.unlines [ " #+begin_src haskell"
57+ , " #+end_src" ] =?>
5858 let attr' = ("", ["haskell"], [])
5959 code' = ""
6060 in codeBlockWith attr' code'
6161
6262 , "Source block between paragraphs" =:
6363 T.unlines [ "Low German greeting"
64− , " #+BEGIN_SRC haskell"
64+ , " #+begin_src haskell"
6565 , " main = putStrLn greeting"
6666 , " where greeting = \"Moin!\""
67− , " #+END_SRC" ] =?>
67+ , " #+end_src" ] =?>
6868 let attr' = ("", ["haskell"], [])
6969 code' = "main = putStrLn greeting\n" <>
7070 " where greeting = \"Moin!\"\n"
@@ -72,10 +72,10 @@ tests =
7272 , codeBlockWith attr' code'
7373 ]
7474 , "Source block with babel arguments" =:
75− T.unlines [ "#+BEGIN_SRC emacs-lisp :exports both"
75+ T.unlines [ "#+begin_src emacs-lisp :exports both"
7676 , "(progn (message \"Hello, World!\")"
7777 , " (+ 23 42))"
78− , "#+END_SRC" ] =?>
78+ , "#+end_src" ] =?>
7979 let classes = [ "commonlisp" ] -- as kate doesn't know emacs-lisp syntax
8080 params = [ ("org-language", "emacs-lisp")
8181 , ("exports", "both")
@@ -85,10 +85,10 @@ tests =
8585 in codeBlockWith ("", classes, params) code'
8686
8787 , "Source block with results and :exports both" =:
88− T.unlines [ "#+BEGIN_SRC emacs-lisp :exports both"
88+ T.unlines [ "#+begin_src emacs-lisp :exports both"
8989 , "(progn (message \"Hello, World!\")"
9090 , " (+ 23 42))"
91− , "#+END_SRC"
91+ , "#+end_src"
9292 , ""
9393 , "#+RESULTS:"
9494 , ": 65"] =?>
@@ -104,10 +104,10 @@ tests =
104104 codeBlockWith ("", ["example"], []) results'
105105
106106 , "Source block with results and :exports code" =:
107− T.unlines [ "#+BEGIN_SRC emacs-lisp :exports code"
107+ T.unlines [ "#+begin_src emacs-lisp :exports code"
108108 , "(progn (message \"Hello, World!\")"
109109 , " (+ 23 42))"
110− , "#+END_SRC"
110+ , "#+end_src"
111111 , ""
112112 , "#+RESULTS:"
113113 , ": 65" ] =?>
@@ -120,10 +120,10 @@ tests =
120120 in codeBlockWith ("", classes, params) code'
121121
122122 , "Source block with results and :exports results" =:
123− T.unlines [ "#+BEGIN_SRC emacs-lisp :exports results"
123+ T.unlines [ "#+begin_src emacs-lisp :exports results"
124124 , "(progn (message \"Hello, World!\")"
125125 , " (+ 23 42))"
126− , "#+END_SRC"
126+ , "#+end_src"
127127 , ""
128128 , "#+RESULTS:"
129129 , ": 65" ] =?>
@@ -131,37 +131,37 @@ tests =
131131 in codeBlockWith ("", ["example"], []) results'
132132
133133 , "Source block with results and :exports none" =:
134− T.unlines [ "#+BEGIN_SRC emacs-lisp :exports none"
134+ T.unlines [ "#+begin_src emacs-lisp :exports none"
135135 , "(progn (message \"Hello, World!\")"
136136 , " (+ 23 42))"
137− , "#+END_SRC"
137+ , "#+end_src"
138138 , ""
139139 , "#+RESULTS:"
140140 , ": 65" ] =?>
141141 (mempty :: Blocks)
142142
143143 , "Source block with toggling header arguments" =:
144− T.unlines [ "#+BEGIN_SRC sh :noeval"
144+ T.unlines [ "#+begin_src sh :noeval"
145145 , "echo $HOME"
146− , "#+END_SRC"
146+ , "#+end_src"
147147 ] =?>
148148 let classes = [ "bash" ]
149149 params = [ ("org-language", "sh"), ("noeval", "yes") ]
150150 in codeBlockWith ("", classes, params) "echo $HOME\n"
151151
152152 , "Source block with line number switch" =:
153− T.unlines [ "#+BEGIN_SRC sh -n 10"
153+ T.unlines [ "#+begin_src sh -n 10"
154154 , ":() { :|:& };:"
155− , "#+END_SRC"
155+ , "#+end_src"
156156 ] =?>
157157 let classes = [ "bash", "numberLines" ]
158158 params = [ ("org-language", "sh"), ("startFrom", "10") ]
159159 in codeBlockWith ("", classes, params) ":() { :|:& };:\n"
160160
161161 , "Source block with multi-word parameter values" =:
162− T.unlines [ "#+BEGIN_SRC dot :cmdline -Kdot -Tpng "
162+ T.unlines [ "#+begin_src dot :cmdline -Kdot -Tpng "
163163 , "digraph { id [label=\"ID\"] }"
164− , "#+END_SRC"
164+ , "#+end_src"
165165 ] =?>
166166 let classes = [ "dot" ]
167167 params = [ ("cmdline", "-Kdot -Tpng") ]
@@ -177,12 +177,12 @@ tests =
177177 "A chosen representation of\na rule.\n"
178178
179179 , "Code block with caption" =:
180− T.unlines [ "#+CAPTION: Functor laws in Haskell"
181− , "#+NAME: functor-laws"
182− , "#+BEGIN_SRC haskell"
180+ T.unlines [ "#+caption: Functor laws in Haskell"
181+ , "#+name: functor-laws"
182+ , "#+begin_src haskell"
183183 , "fmap id = id"
184184 , "fmap (p . q) = (fmap p) . (fmap q)"
185− , "#+END_SRC"
185+ , "#+end_src"
186186 ] =?>
187187 divWith
188188 nullAttr
@@ -195,9 +195,9 @@ tests =
195195 ])))
196196
197197 , "Non-letter chars in source block parameters" =:
198− T.unlines [ "#+BEGIN_SRC C :tangle xxxx.c :city Zürich"
198+ T.unlines [ "#+begin_src C :tangle xxxx.c :city Zürich"
199199 , "code body"
200− , "#+END_SRC"
200+ , "#+end_src"
201201 ] =?>
202202 let params = [ ("org-language", "C")
203203 , ("tangle", "xxxx.c")