git.iko.soy/typeable/pandoc
on master help sign in
Replace org #+KEYWORDS with #+keywords
0306eecTEC
data/templates/default.org+3−3
@@ -1,12 +1,12 @@
1$if(title)$
1$if(title)$
2−#+TITLE: $title$
2+#+title: $title$
3
3
4$endif$
4$endif$
5$if(author)$
5$if(author)$
6−#+AUTHOR: $for(author)$$author$$sep$; $endfor$
6+#+author: $for(author)$$author$$sep$; $endfor$
7$endif$
7$endif$
8$if(date)$
8$if(date)$
9−#+DATE: $date$
9+#+date: $date$
10
10
11$endif$
11$endif$
12$for(header-includes)$
12$for(header-includes)$
src/Text/Pandoc/Readers/Org/Blocks.hs+11−11
@@ -111,23 +111,23 @@ attrFromBlockAttributes BlockAttributes{..} =
111stringyMetaAttribute :: Monad m => OrgParser m (Text, Text)
111stringyMetaAttribute :: Monad m => OrgParser m (Text, Text)
112stringyMetaAttribute = try $ do
112stringyMetaAttribute = try $ do
113 metaLineStart
113 metaLineStart
114− attrName <- T.toUpper <$> many1TillChar nonspaceChar (char ':')
114+ attrName <- T.toLower <$> many1TillChar nonspaceChar (char ':')
115 skipSpaces
115 skipSpaces
116 attrValue <- anyLine <|> ("" <$ newline)
116 attrValue <- anyLine <|> ("" <$ newline)
117 return (attrName, attrValue)
117 return (attrName, attrValue)
118
118
119-- | Parse a set of block attributes. Block attributes are given through
119-- | Parse a set of block attributes. Block attributes are given through
120−-- lines like @#+CAPTION: block caption@ or @#+ATTR_HTML: :width 20@.
120+-- lines like @#+caption: block caption@ or @#+attr_html: :width 20@.
121-- Parsing will fail if any line contains an attribute different from
121-- Parsing will fail if any line contains an attribute different from
122-- those attributes known to work on blocks.
122-- those attributes known to work on blocks.
123blockAttributes :: PandocMonad m => OrgParser m BlockAttributes
123blockAttributes :: PandocMonad m => OrgParser m BlockAttributes
124blockAttributes = try $ do
124blockAttributes = try $ do
125 kv <- many stringyMetaAttribute
125 kv <- many stringyMetaAttribute
126 guard $ all (isBlockAttr . fst) kv
126 guard $ all (isBlockAttr . fst) kv
127− let caption = foldl' (appendValues "CAPTION") Nothing kv
127+ let caption = foldl' (appendValues "caption") Nothing kv
128− let kvAttrs = foldl' (appendValues "ATTR_HTML") Nothing kv
128+ let kvAttrs = foldl' (appendValues "attr_html") Nothing kv
129− let name = lookup "NAME" kv
129+ let name = lookup "name" kv
130− let label = lookup "LABEL" kv
130+ let label = lookup "label" kv
131 caption' <- traverse (parseFromString inlines . (<> "\n")) caption
131 caption' <- traverse (parseFromString inlines . (<> "\n")) caption
132 kvAttrs' <- parseFromString keyValues . (<> "\n") $ fromMaybe mempty kvAttrs
132 kvAttrs' <- parseFromString keyValues . (<> "\n") $ fromMaybe mempty kvAttrs
133 return BlockAttributes
133 return BlockAttributes
@@ -139,9 +139,9 @@ blockAttributes = try $ do
139 where
139 where
140 isBlockAttr :: Text -> Bool
140 isBlockAttr :: Text -> Bool
141 isBlockAttr = flip elem
141 isBlockAttr = flip elem
142− [ "NAME", "LABEL", "CAPTION"
142+ [ "name", "label", "caption"
143− , "ATTR_HTML", "ATTR_LATEX"
143+ , "attr_html", "attr_latex"
144− , "RESULTS"
144+ , "results"
145 ]
145 ]
146
146
147 appendValues :: Text -> Maybe Text -> (Text, Text) -> Maybe Text
147 appendValues :: Text -> Maybe Text -> (Text, Text) -> Maybe Text
@@ -170,10 +170,10 @@ keyValues = try $
170
170
171
171
172--
172--
173−-- Org Blocks (#+BEGIN_... / #+END_...)
173+-- Org Blocks (#+begin_... / #+end_...)
174--
174--
175
175
176−-- | Read an org-mode block delimited by #+BEGIN_TYPE and #+END_TYPE.
176+-- | Read an org-mode block delimited by #+begin_type and #+end_type.
177orgBlock :: PandocMonad m => OrgParser m (F Blocks)
177orgBlock :: PandocMonad m => OrgParser m (F Blocks)
178orgBlock = try $ do
178orgBlock = try $ do
179 blockAttrs <- blockAttributes
179 blockAttrs <- blockAttributes
src/Text/Pandoc/Writers/Org.hs+16−16
@@ -106,7 +106,7 @@ blockToOrg (Para [Image attr txt (src,tgt)])
106 | Just tit <- T.stripPrefix "fig:" tgt = do
106 | Just tit <- T.stripPrefix "fig:" tgt = do
107 capt <- if null txt
107 capt <- if null txt
108 then return empty
108 then return empty
109− else ("#+CAPTION: " <>) `fmap` inlineListToOrg txt
109+ else ("#+caption: " <>) `fmap` inlineListToOrg txt
110 img <- inlineToOrg (Image attr txt (src,tit))
110 img <- inlineToOrg (Image attr txt (src,tit))
111 return $ capt $$ img $$ blankline
111 return $ capt $$ img $$ blankline
112blockToOrg (Para inlines) = do
112blockToOrg (Para inlines) = do
@@ -121,11 +121,11 @@ blockToOrg (LineBlock lns) = do
121 let joinWithBlankLines = mconcat . intersperse blankline
121 let joinWithBlankLines = mconcat . intersperse blankline
122 let prettifyStanza ls = joinWithLinefeeds <$> mapM inlineListToOrg ls
122 let prettifyStanza ls = joinWithLinefeeds <$> mapM inlineListToOrg ls
123 contents <- joinWithBlankLines <$> mapM prettifyStanza (splitStanza lns)
123 contents <- joinWithBlankLines <$> mapM prettifyStanza (splitStanza lns)
124− return $ blankline $$ "#+BEGIN_VERSE" $$
124+ return $ blankline $$ "#+begin_verse" $$
125− nest 2 contents $$ "#+END_VERSE" <> blankline
125+ nest 2 contents $$ "#+end_verse" <> blankline
126blockToOrg (RawBlock "html" str) =
126blockToOrg (RawBlock "html" str) =
127− return $ blankline $$ "#+BEGIN_HTML" $$
127+ return $ blankline $$ "#+begin_html" $$
128− nest 2 (literal str) $$ "#+END_HTML" $$ blankline
128+ nest 2 (literal str) $$ "#+end_html" $$ blankline
129blockToOrg b@(RawBlock f str)
129blockToOrg b@(RawBlock f str)
130 | isRawFormat f = return $ literal str
130 | isRawFormat f = return $ literal str
131 | otherwise = do
131 | otherwise = do
@@ -148,19 +148,19 @@ blockToOrg (CodeBlock (_,classes,kvs) str) = do
148 else ""
148 else ""
149 let at = map pandocLangToOrg classes `intersect` orgLangIdentifiers
149 let at = map pandocLangToOrg classes `intersect` orgLangIdentifiers
150 let (beg, end) = case at of
150 let (beg, end) = case at of
151− [] -> ("#+BEGIN_EXAMPLE" <> numberlines, "#+END_EXAMPLE")
151+ [] -> ("#+begin_example" <> numberlines, "#+end_example")
152− (x:_) -> ("#+BEGIN_SRC " <> x <> numberlines, "#+END_SRC")
152+ (x:_) -> ("#+begin_src " <> x <> numberlines, "#+end_src")
153 return $ literal beg $$ nest 2 (literal str) $$ text end $$ blankline
153 return $ literal beg $$ nest 2 (literal str) $$ text end $$ blankline
154blockToOrg (BlockQuote blocks) = do
154blockToOrg (BlockQuote blocks) = do
155 contents <- blockListToOrg blocks
155 contents <- blockListToOrg blocks
156− return $ blankline $$ "#+BEGIN_QUOTE" $$
156+ return $ blankline $$ "#+begin_quote" $$
157− nest 2 contents $$ "#+END_QUOTE" $$ blankline
157+ nest 2 contents $$ "#+end_quote" $$ blankline
158blockToOrg (Table _ blkCapt specs thead tbody tfoot) = do
158blockToOrg (Table _ blkCapt specs thead tbody tfoot) = do
159 let (caption', _, _, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot
159 let (caption', _, _, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot
160 caption'' <- inlineListToOrg caption'
160 caption'' <- inlineListToOrg caption'
161 let caption = if null caption'
161 let caption = if null caption'
162 then empty
162 then empty
163− else "#+CAPTION: " <> caption''
163+ else "#+caption: " <> caption''
164 headers' <- mapM blockListToOrg headers
164 headers' <- mapM blockListToOrg headers
165 rawRows <- mapM (mapM blockListToOrg) rows
165 rawRows <- mapM (mapM blockListToOrg) rows
166 let numChars = maximum . map offset
166 let numChars = maximum . map offset
@@ -292,12 +292,12 @@ divToOrg attr bs = do
292 case divBlockType attr of
292 case divBlockType attr of
293 GreaterBlock blockName attr' ->
293 GreaterBlock blockName attr' ->
294 -- Write as greater block. The ID, if present, is added via
294 -- Write as greater block. The ID, if present, is added via
295− -- the #+NAME keyword; other classes and key-value pairs
295+ -- the #+name keyword; other classes and key-value pairs
296− -- are kept as #+ATTR_HTML attributes.
296+ -- are kept as #+attr_html attributes.
297 return $ blankline $$ attrHtml attr'
297 return $ blankline $$ attrHtml attr'
298− $$ "#+BEGIN_" <> literal blockName
298+ $$ "#+begin_" <> literal blockName
299 $$ contents
299 $$ contents
300− $$ "#+END_" <> literal blockName $$ blankline
300+ $$ "#+end_" <> literal blockName $$ blankline
301 Drawer drawerName (_,_,kvs) -> do
301 Drawer drawerName (_,_,kvs) -> do
302 -- Write as drawer. Only key-value pairs are retained.
302 -- Write as drawer. Only key-value pairs are retained.
303 let keys = vcat $ map (\(k,v) ->
303 let keys = vcat $ map (\(k,v) ->
@@ -320,8 +320,8 @@ attrHtml :: Attr -> Doc Text
320attrHtml ("" , [] , []) = mempty
320attrHtml ("" , [] , []) = mempty
321attrHtml (ident, classes, kvs) =
321attrHtml (ident, classes, kvs) =
322 let
322 let
323− name = if T.null ident then mempty else "#+NAME: " <> literal ident <> cr
323+ name = if T.null ident then mempty else "#+name: " <> literal ident <> cr
324− keyword = "#+ATTR_HTML"
324+ keyword = "#+attr_html"
325 classKv = ("class", T.unwords classes)
325 classKv = ("class", T.unwords classes)
326 kvStrings = map (\(k,v) -> ":" <> k <> " " <> v) (classKv:kvs)
326 kvStrings = map (\(k,v) -> ":" <> k <> " " <> v) (classKv:kvs)
327 in name <> keyword <> ": " <> literal (T.unwords kvStrings) <> cr
327 in name <> keyword <> ": " <> literal (T.unwords kvStrings) <> cr
test/Tests/Readers/Org/Block.hs+21−21
@@ -75,10 +75,10 @@ tests =
75
75
76 , testGroup "Comments"
76 , testGroup "Comments"
77 [ "Comment Block" =:
77 [ "Comment Block" =:
78− T.unlines [ "#+BEGIN_COMMENT"
78+ T.unlines [ "#+begin_comment"
79 , "stuff"
79 , "stuff"
80 , "bla"
80 , "bla"
81− , "#+END_COMMENT"] =?>
81+ , "#+end_comment"] =?>
82 (mempty::Blocks)
82 (mempty::Blocks)
83
83
84 , "Comment line" =:
84 , "Comment line" =:
@@ -92,16 +92,16 @@ tests =
92
92
93 , testGroup "Blocks and fragments"
93 , testGroup "Blocks and fragments"
94 [ "HTML block" =:
94 [ "HTML block" =:
95− T.unlines [ "#+BEGIN_HTML"
95+ T.unlines [ "#+begin_html"
96 , "<aside>HTML5 is pretty nice.</aside>"
96 , "<aside>HTML5 is pretty nice.</aside>"
97− , "#+END_HTML"
97+ , "#+end_html"
98 ] =?>
98 ] =?>
99 rawBlock "html" "<aside>HTML5 is pretty nice.</aside>\n"
99 rawBlock "html" "<aside>HTML5 is pretty nice.</aside>\n"
100
100
101 , "Quote block" =:
101 , "Quote block" =:
102− T.unlines [ "#+BEGIN_QUOTE"
102+ T.unlines [ "#+begin_quote"
103 , "/Niemand/ hat die Absicht, eine Mauer zu errichten!"
103 , "/Niemand/ hat die Absicht, eine Mauer zu errichten!"
104− , "#+END_QUOTE"
104+ , "#+end_quote"
105 ] =?>
105 ] =?>
106 blockQuote (para (spcSep [ emph "Niemand", "hat", "die", "Absicht,"
106 blockQuote (para (spcSep [ emph "Niemand", "hat", "die", "Absicht,"
107 , "eine", "Mauer", "zu", "errichten!"
107 , "eine", "Mauer", "zu", "errichten!"
@@ -128,31 +128,31 @@ tests =
128 ]
128 ]
129
129
130 , "Verse block with blank lines" =:
130 , "Verse block with blank lines" =:
131− T.unlines [ "#+BEGIN_VERSE"
131+ T.unlines [ "#+begin_verse"
132 , "foo"
132 , "foo"
133 , ""
133 , ""
134 , "bar"
134 , "bar"
135− , "#+END_VERSE"
135+ , "#+end_verse"
136 ] =?>
136 ] =?>
137 lineBlock [ "foo", mempty, "bar" ]
137 lineBlock [ "foo", mempty, "bar" ]
138
138
139 , "Verse block with varying indentation" =:
139 , "Verse block with varying indentation" =:
140− T.unlines [ "#+BEGIN_VERSE"
140+ T.unlines [ "#+begin_verse"
141 , " hello darkness"
141 , " hello darkness"
142 , "my old friend"
142 , "my old friend"
143− , "#+END_VERSE"
143+ , "#+end_verse"
144 ] =?>
144 ] =?>
145 lineBlock [ "\160\160hello darkness", "my old friend" ]
145 lineBlock [ "\160\160hello darkness", "my old friend" ]
146
146
147 , "Raw block LaTeX" =:
147 , "Raw block LaTeX" =:
148− T.unlines [ "#+BEGIN_LaTeX"
148+ T.unlines [ "#+begin_latex"
149 , "The category $\\cat{Set}$ is adhesive."
149 , "The category $\\cat{Set}$ is adhesive."
150− , "#+END_LaTeX"
150+ , "#+end_latex"
151 ] =?>
151 ] =?>
152 rawBlock "latex" "The category $\\cat{Set}$ is adhesive.\n"
152 rawBlock "latex" "The category $\\cat{Set}$ is adhesive.\n"
153
153
154 , "Raw LaTeX line" =:
154 , "Raw LaTeX line" =:
155− "#+LATEX: \\let\\foo\\bar" =?>
155+ "#+latex: \\let\\foo\\bar" =?>
156 rawBlock "latex" "\\let\\foo\\bar"
156 rawBlock "latex" "\\let\\foo\\bar"
157
157
158 , "Raw Beamer line" =:
158 , "Raw Beamer line" =:
@@ -160,13 +160,13 @@ tests =
160 rawBlock "beamer" "\\pause"
160 rawBlock "beamer" "\\pause"
161
161
162 , "Raw HTML line" =:
162 , "Raw HTML line" =:
163− "#+HTML: <aside>not important</aside>" =?>
163+ "#+html: <aside>not important</aside>" =?>
164 rawBlock "html" "<aside>not important</aside>"
164 rawBlock "html" "<aside>not important</aside>"
165
165
166 , "Export block HTML" =:
166 , "Export block HTML" =:
167− T.unlines [ "#+BEGIN_export html"
167+ T.unlines [ "#+begin_export html"
168 , "<samp>Hello, World!</samp>"
168 , "<samp>Hello, World!</samp>"
169− , "#+END_export"
169+ , "#+end_export"
170 ] =?>
170 ] =?>
171 rawBlock "html" "<samp>Hello, World!</samp>\n"
171 rawBlock "html" "<samp>Hello, World!</samp>\n"
172
172
@@ -197,13 +197,13 @@ tests =
197 ] =?>
197 ] =?>
198 rawBlock "html" "\n<span>boring</span>\n\n"
198 rawBlock "html" "\n<span>boring</span>\n\n"
199
199
200− , "Accept `ATTR_HTML` attributes for generic block" =:
200+ , "Accept `attr_html` attributes for generic block" =:
201− T.unlines [ "#+ATTR_HTML: :title hello, world :id test :class fun code"
201+ T.unlines [ "#+attr_html: :title hello, world :id test :class fun code"
202− , "#+BEGIN_TEST"
202+ , "#+begin_test"
203 , "nonsense"
203 , "nonsense"
204− , "#+END_TEST"
204+ , "#+end_test"
205 ] =?>
205 ] =?>
206− let attr = ("test", ["fun", "code", "TEST"], [("title", "hello, world")])
206+ let attr = ("test", ["fun", "code", "test"], [("title", "hello, world")])
207 in divWith attr (para "nonsense")
207 in divWith attr (para "nonsense")
208 ]
208 ]
209
209
test/Tests/Readers/Org/Block/CodeBlock.hs+32−32
@@ -23,48 +23,48 @@ import qualified Data.Text as T
23tests :: [TestTree]
23tests :: [TestTree]
24tests =
24tests =
25 [ "Source block" =:
25 [ "Source block" =:
26− T.unlines [ " #+BEGIN_SRC haskell"
26+ T.unlines [ " #+begin_src haskell"
27 , " main = putStrLn greeting"
27 , " main = putStrLn greeting"
28 , " where greeting = \"moin\""
28 , " where greeting = \"moin\""
29− , " #+END_SRC" ] =?>
29+ , " #+end_src" ] =?>
30 let attr' = ("", ["haskell"], [])
30 let attr' = ("", ["haskell"], [])
31 code' = "main = putStrLn greeting\n" <>
31 code' = "main = putStrLn greeting\n" <>
32 " where greeting = \"moin\"\n"
32 " where greeting = \"moin\"\n"
33 in codeBlockWith attr' code'
33 in codeBlockWith attr' code'
34
34
35 , "Source block with indented code" =:
35 , "Source block with indented code" =:
36− T.unlines [ " #+BEGIN_SRC haskell"
36+ T.unlines [ " #+begin_src haskell"
37 , " main = putStrLn greeting"
37 , " main = putStrLn greeting"
38 , " where greeting = \"moin\""
38 , " where greeting = \"moin\""
39− , " #+END_SRC" ] =?>
39+ , " #+end_src" ] =?>
40 let attr' = ("", ["haskell"], [])
40 let attr' = ("", ["haskell"], [])
41 code' = "main = putStrLn greeting\n" <>
41 code' = "main = putStrLn greeting\n" <>
42 " where greeting = \"moin\"\n"
42 " where greeting = \"moin\"\n"
43 in codeBlockWith attr' code'
43 in codeBlockWith attr' code'
44
44
45 , "Source block with tab-indented code" =:
45 , "Source block with tab-indented code" =:
46− T.unlines [ "\t#+BEGIN_SRC haskell"
46+ T.unlines [ "\t#+begin_src haskell"
47 , "\tmain = putStrLn greeting"
47 , "\tmain = putStrLn greeting"
48 , "\t where greeting = \"moin\""
48 , "\t where greeting = \"moin\""
49− , "\t#+END_SRC" ] =?>
49+ , "\t#+end_src" ] =?>
50 let attr' = ("", ["haskell"], [])
50 let attr' = ("", ["haskell"], [])
51 code' = "main = putStrLn greeting\n" <>
51 code' = "main = putStrLn greeting\n" <>
52 " where greeting = \"moin\"\n"
52 " where greeting = \"moin\"\n"
53 in codeBlockWith attr' code'
53 in codeBlockWith attr' code'
54
54
55 , "Empty source block" =:
55 , "Empty source block" =:
56− T.unlines [ " #+BEGIN_SRC haskell"
56+ T.unlines [ " #+begin_src haskell"
57− , " #+END_SRC" ] =?>
57+ , " #+end_src" ] =?>
58 let attr' = ("", ["haskell"], [])
58 let attr' = ("", ["haskell"], [])
59 code' = ""
59 code' = ""
60 in codeBlockWith attr' code'
60 in codeBlockWith attr' code'
61
61
62 , "Source block between paragraphs" =:
62 , "Source block between paragraphs" =:
63 T.unlines [ "Low German greeting"
63 T.unlines [ "Low German greeting"
64− , " #+BEGIN_SRC haskell"
64+ , " #+begin_src haskell"
65 , " main = putStrLn greeting"
65 , " main = putStrLn greeting"
66 , " where greeting = \"Moin!\""
66 , " where greeting = \"Moin!\""
67− , " #+END_SRC" ] =?>
67+ , " #+end_src" ] =?>
68 let attr' = ("", ["haskell"], [])
68 let attr' = ("", ["haskell"], [])
69 code' = "main = putStrLn greeting\n" <>
69 code' = "main = putStrLn greeting\n" <>
70 " where greeting = \"Moin!\"\n"
70 " where greeting = \"Moin!\"\n"
@@ -72,10 +72,10 @@ tests =
72 , codeBlockWith attr' code'
72 , codeBlockWith attr' code'
73 ]
73 ]
74 , "Source block with babel arguments" =:
74 , "Source block with babel arguments" =:
75− T.unlines [ "#+BEGIN_SRC emacs-lisp :exports both"
75+ T.unlines [ "#+begin_src emacs-lisp :exports both"
76 , "(progn (message \"Hello, World!\")"
76 , "(progn (message \"Hello, World!\")"
77 , " (+ 23 42))"
77 , " (+ 23 42))"
78− , "#+END_SRC" ] =?>
78+ , "#+end_src" ] =?>
79 let classes = [ "commonlisp" ] -- as kate doesn't know emacs-lisp syntax
79 let classes = [ "commonlisp" ] -- as kate doesn't know emacs-lisp syntax
80 params = [ ("org-language", "emacs-lisp")
80 params = [ ("org-language", "emacs-lisp")
81 , ("exports", "both")
81 , ("exports", "both")
@@ -85,10 +85,10 @@ tests =
85 in codeBlockWith ("", classes, params) code'
85 in codeBlockWith ("", classes, params) code'
86
86
87 , "Source block with results and :exports both" =:
87 , "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"
89 , "(progn (message \"Hello, World!\")"
89 , "(progn (message \"Hello, World!\")"
90 , " (+ 23 42))"
90 , " (+ 23 42))"
91− , "#+END_SRC"
91+ , "#+end_src"
92 , ""
92 , ""
93 , "#+RESULTS:"
93 , "#+RESULTS:"
94 , ": 65"] =?>
94 , ": 65"] =?>
@@ -104,10 +104,10 @@ tests =
104 codeBlockWith ("", ["example"], []) results'
104 codeBlockWith ("", ["example"], []) results'
105
105
106 , "Source block with results and :exports code" =:
106 , "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"
108 , "(progn (message \"Hello, World!\")"
108 , "(progn (message \"Hello, World!\")"
109 , " (+ 23 42))"
109 , " (+ 23 42))"
110− , "#+END_SRC"
110+ , "#+end_src"
111 , ""
111 , ""
112 , "#+RESULTS:"
112 , "#+RESULTS:"
113 , ": 65" ] =?>
113 , ": 65" ] =?>
@@ -120,10 +120,10 @@ tests =
120 in codeBlockWith ("", classes, params) code'
120 in codeBlockWith ("", classes, params) code'
121
121
122 , "Source block with results and :exports results" =:
122 , "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"
124 , "(progn (message \"Hello, World!\")"
124 , "(progn (message \"Hello, World!\")"
125 , " (+ 23 42))"
125 , " (+ 23 42))"
126− , "#+END_SRC"
126+ , "#+end_src"
127 , ""
127 , ""
128 , "#+RESULTS:"
128 , "#+RESULTS:"
129 , ": 65" ] =?>
129 , ": 65" ] =?>
@@ -131,37 +131,37 @@ tests =
131 in codeBlockWith ("", ["example"], []) results'
131 in codeBlockWith ("", ["example"], []) results'
132
132
133 , "Source block with results and :exports none" =:
133 , "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"
135 , "(progn (message \"Hello, World!\")"
135 , "(progn (message \"Hello, World!\")"
136 , " (+ 23 42))"
136 , " (+ 23 42))"
137− , "#+END_SRC"
137+ , "#+end_src"
138 , ""
138 , ""
139 , "#+RESULTS:"
139 , "#+RESULTS:"
140 , ": 65" ] =?>
140 , ": 65" ] =?>
141 (mempty :: Blocks)
141 (mempty :: Blocks)
142
142
143 , "Source block with toggling header arguments" =:
143 , "Source block with toggling header arguments" =:
144− T.unlines [ "#+BEGIN_SRC sh :noeval"
144+ T.unlines [ "#+begin_src sh :noeval"
145 , "echo $HOME"
145 , "echo $HOME"
146− , "#+END_SRC"
146+ , "#+end_src"
147 ] =?>
147 ] =?>
148 let classes = [ "bash" ]
148 let classes = [ "bash" ]
149 params = [ ("org-language", "sh"), ("noeval", "yes") ]
149 params = [ ("org-language", "sh"), ("noeval", "yes") ]
150 in codeBlockWith ("", classes, params) "echo $HOME\n"
150 in codeBlockWith ("", classes, params) "echo $HOME\n"
151
151
152 , "Source block with line number switch" =:
152 , "Source block with line number switch" =:
153− T.unlines [ "#+BEGIN_SRC sh -n 10"
153+ T.unlines [ "#+begin_src sh -n 10"
154 , ":() { :|:& };:"
154 , ":() { :|:& };:"
155− , "#+END_SRC"
155+ , "#+end_src"
156 ] =?>
156 ] =?>
157 let classes = [ "bash", "numberLines" ]
157 let classes = [ "bash", "numberLines" ]
158 params = [ ("org-language", "sh"), ("startFrom", "10") ]
158 params = [ ("org-language", "sh"), ("startFrom", "10") ]
159 in codeBlockWith ("", classes, params) ":() { :|:& };:\n"
159 in codeBlockWith ("", classes, params) ":() { :|:& };:\n"
160
160
161 , "Source block with multi-word parameter values" =:
161 , "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 "
163 , "digraph { id [label=\"ID\"] }"
163 , "digraph { id [label=\"ID\"] }"
164− , "#+END_SRC"
164+ , "#+end_src"
165 ] =?>
165 ] =?>
166 let classes = [ "dot" ]
166 let classes = [ "dot" ]
167 params = [ ("cmdline", "-Kdot -Tpng") ]
167 params = [ ("cmdline", "-Kdot -Tpng") ]
@@ -177,12 +177,12 @@ tests =
177 "A chosen representation of\na rule.\n"
177 "A chosen representation of\na rule.\n"
178
178
179 , "Code block with caption" =:
179 , "Code block with caption" =:
180− T.unlines [ "#+CAPTION: Functor laws in Haskell"
180+ T.unlines [ "#+caption: Functor laws in Haskell"
181− , "#+NAME: functor-laws"
181+ , "#+name: functor-laws"
182− , "#+BEGIN_SRC haskell"
182+ , "#+begin_src haskell"
183 , "fmap id = id"
183 , "fmap id = id"
184 , "fmap (p . q) = (fmap p) . (fmap q)"
184 , "fmap (p . q) = (fmap p) . (fmap q)"
185− , "#+END_SRC"
185+ , "#+end_src"
186 ] =?>
186 ] =?>
187 divWith
187 divWith
188 nullAttr
188 nullAttr
@@ -195,9 +195,9 @@ tests =
195 ])))
195 ])))
196
196
197 , "Non-letter chars in source block parameters" =:
197 , "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"
199 , "code body"
199 , "code body"
200− , "#+END_SRC"
200+ , "#+end_src"
201 ] =?>
201 ] =?>
202 let params = [ ("org-language", "C")
202 let params = [ ("org-language", "C")
203 , ("tangle", "xxxx.c")
203 , ("tangle", "xxxx.c")
test/Tests/Readers/Org/Block/Figure.hs+8−8
@@ -44,9 +44,9 @@ tests =
44 "Used as a metapher in evolutionary biology.")
44 "Used as a metapher in evolutionary biology.")
45
45
46 , "Figure with HTML attributes" =:
46 , "Figure with HTML attributes" =:
47− T.unlines [ "#+CAPTION: mah brain just explodid"
47+ T.unlines [ "#+caption: mah brain just explodid"
48− , "#+NAME: lambdacat"
48+ , "#+name: lambdacat"
49− , "#+ATTR_HTML: :style color: blue :role button"
49+ , "#+attr_html: :style color: blue :role button"
50 , "[[file:lambdacat.jpg]]"
50 , "[[file:lambdacat.jpg]]"
51 ] =?>
51 ] =?>
52 let kv = [("style", "color: blue"), ("role", "button")]
52 let kv = [("style", "color: blue"), ("role", "button")]
@@ -55,22 +55,22 @@ tests =
55 in para (imageWith (mempty, mempty, kv) "lambdacat.jpg" name caption)
55 in para (imageWith (mempty, mempty, kv) "lambdacat.jpg" name caption)
56
56
57 , "LaTeX attributes are ignored" =:
57 , "LaTeX attributes are ignored" =:
58− T.unlines [ "#+CAPTION: Attribute after caption"
58+ T.unlines [ "#+caption: Attribute after caption"
59− , "#+ATTR_LATEX: :float nil"
59+ , "#+attr_latex: :float nil"
60 , "[[file:test.png]]"
60 , "[[file:test.png]]"
61 ] =?>
61 ] =?>
62 para (image "test.png" "fig:" "Attribute after caption")
62 para (image "test.png" "fig:" "Attribute after caption")
63
63
64 , "Labelled figure" =:
64 , "Labelled figure" =:
65− T.unlines [ "#+CAPTION: My figure"
65+ T.unlines [ "#+caption: My figure"
66− , "#+LABEL: fig:myfig"
66+ , "#+label: fig:myfig"
67 , "[[file:blub.png]]"
67 , "[[file:blub.png]]"
68 ] =?>
68 ] =?>
69 let attr = ("fig:myfig", mempty, mempty)
69 let attr = ("fig:myfig", mempty, mempty)
70 in para (imageWith attr "blub.png" "fig:" "My figure")
70 in para (imageWith attr "blub.png" "fig:" "My figure")
71
71
72 , "Figure with empty caption" =:
72 , "Figure with empty caption" =:
73− T.unlines [ "#+CAPTION:"
73+ T.unlines [ "#+caption:"
74 , "[[file:guess.jpg]]"
74 , "[[file:guess.jpg]]"
75 ] =?>
75 ] =?>
76 para (image "guess.jpg" "fig:" "")
76 para (image "guess.jpg" "fig:" "")
test/Tests/Readers/Org/Block/Header.hs+3−3
@@ -99,7 +99,7 @@ tests =
99 headerWith ("waiting-header", [], []) 1 "WAITING header"
99 headerWith ("waiting-header", [], []) 1 "WAITING header"
100
100
101 , "Custom todo keywords" =:
101 , "Custom todo keywords" =:
102− T.unlines [ "#+TODO: WAITING CANCELLED"
102+ T.unlines [ "#+todo: WAITING CANCELLED"
103 , "* WAITING compile"
103 , "* WAITING compile"
104 , "* CANCELLED lunch"
104 , "* CANCELLED lunch"
105 ] =?>
105 ] =?>
@@ -109,7 +109,7 @@ tests =
109 <> headerWith ("lunch", [], []) 1 (doneSpan <> space <> "lunch")
109 <> headerWith ("lunch", [], []) 1 (doneSpan <> space <> "lunch")
110
110
111 , "Custom todo keywords with multiple done-states" =:
111 , "Custom todo keywords with multiple done-states" =:
112− T.unlines [ "#+TODO: WAITING | DONE CANCELLED "
112+ T.unlines [ "#+todo: WAITING | DONE CANCELLED "
113 , "* WAITING compile"
113 , "* WAITING compile"
114 , "* CANCELLED lunch"
114 , "* CANCELLED lunch"
115 , "* DONE todo-feature"
115 , "* DONE todo-feature"
@@ -248,7 +248,7 @@ tests =
248 headerWith ("look", [], []) 1 "important"
248 headerWith ("look", [], []) 1 "important"
249
249
250 , "third and forth level headers" =:
250 , "third and forth level headers" =:
251− T.unlines [ "#+OPTIONS: p:t h:3"
251+ T.unlines [ "#+options: p:t h:3"
252 , "*** Third"
252 , "*** Third"
253 , " CLOSED: [2018-09-05 Wed 13:58]"
253 , " CLOSED: [2018-09-05 Wed 13:58]"
254 , " Text 3"
254 , " Text 3"
test/Tests/Readers/Org/Block/Table.hs+2−2
@@ -167,7 +167,7 @@ tests =
167 ]
167 ]
168
168
169 , "Table with caption" =:
169 , "Table with caption" =:
170− T.unlines [ "#+CAPTION: Hitchhiker's Multiplication Table"
170+ T.unlines [ "#+caption: Hitchhiker's Multiplication Table"
171 , "| x | 6 |"
171 , "| x | 6 |"
172 , "| 9 | 42 |"
172 , "| 9 | 42 |"
173 ] =?>
173 ] =?>
@@ -180,7 +180,7 @@ tests =
180 ]
180 ]
181
181
182 , "named table" =:
182 , "named table" =:
183− T.unlines [ "#+NAME: x-marks-the-spot"
183+ T.unlines [ "#+name: x-marks-the-spot"
184 , "| x |"
184 , "| x |"
185 ] =?>
185 ] =?>
186 divWith ("x-marks-the-spot", mempty, mempty)
186 divWith ("x-marks-the-spot", mempty, mempty)
test/Tests/Readers/Org/Inline.hs+1−1
@@ -210,7 +210,7 @@ tests =
210 <> image "sunset.jpg" "" "")
210 <> image "sunset.jpg" "" "")
211
211
212 , "Image with html attributes" =:
212 , "Image with html attributes" =:
213− T.unlines [ "#+ATTR_HTML: :width 50%"
213+ T.unlines [ "#+attr_html: :width 50%"
214 , "[[file:guinea-pig.gif]]"
214 , "[[file:guinea-pig.gif]]"
215 ] =?>
215 ] =?>
216 para (imageWith ("", [], [("width", "50%")]) "guinea-pig.gif" "" "")
216 para (imageWith ("", [], [("width", "50%")]) "guinea-pig.gif" "" "")
test/Tests/Readers/Org/Meta.hs+25−25
@@ -44,7 +44,7 @@ tests =
44
44
45 , testGroup "Export settings"
45 , testGroup "Export settings"
46 [ "Title" =:
46 [ "Title" =:
47− "#+TITLE: Hello, World" =?>
47+ "#+title: Hello, World" =?>
48 let titleInline = toList $ "Hello," <> space <> "World"
48 let titleInline = toList $ "Hello," <> space <> "World"
49 meta = setMeta "title" (MetaInlines titleInline) nullMeta
49 meta = setMeta "title" (MetaInlines titleInline) nullMeta
50 in Pandoc meta mempty
50 in Pandoc meta mempty
@@ -69,21 +69,21 @@ tests =
69 ]
69 ]
70
70
71 , "Date" =:
71 , "Date" =:
72− "#+Date: Feb. *28*, 2014" =?>
72+ "#+date: Feb. *28*, 2014" =?>
73 let date = toList . spcSep $ [ "Feb.", strong "28" <> ",", "2014" ]
73 let date = toList . spcSep $ [ "Feb.", strong "28" <> ",", "2014" ]
74 meta = setMeta "date" (MetaInlines date) nullMeta
74 meta = setMeta "date" (MetaInlines date) nullMeta
75 in Pandoc meta mempty
75 in Pandoc meta mempty
76
76
77 , testGroup "Description"
77 , testGroup "Description"
78 [ "Single line" =:
78 [ "Single line" =:
79− "#+DESCRIPTION: Explanatory text" =?>
79+ "#+description: Explanatory text" =?>
80 let description = [Str "Explanatory", Space, Str "text"]
80 let description = [Str "Explanatory", Space, Str "text"]
81 meta = setMeta "description" (MetaInlines description) nullMeta
81 meta = setMeta "description" (MetaInlines description) nullMeta
82 in Pandoc meta mempty
82 in Pandoc meta mempty
83
83
84 , "Multiline" =:
84 , "Multiline" =:
85− T.unlines [ "#+DESCRIPTION: /Short/ introduction"
85+ T.unlines [ "#+description: /Short/ introduction"
86− , "#+DESCRIPTION: to Org-mode"
86+ , "#+description: to Org-mode"
87 ] =?>
87 ] =?>
88 let description = [ Emph [Str "Short"], Space, Str "introduction"
88 let description = [ Emph [Str "Short"], Space, Str "introduction"
89 , SoftBreak
89 , SoftBreak
@@ -94,54 +94,54 @@ tests =
94 ]
94 ]
95
95
96 , "Subtitle" =:
96 , "Subtitle" =:
97− T.unlines [ "#+SUBTITLE: Your Life in"
97+ T.unlines [ "#+subtitle: Your Life in"
98− , "#+SUBTITLE: /Plain/ Text"
98+ , "#+subtitle: /Plain/ Text"
99 ] =?>
99 ] =?>
100 let subtitle = "Your Life in" <> softbreak <> emph "Plain" <> " Text"
100 let subtitle = "Your Life in" <> softbreak <> emph "Plain" <> " Text"
101 in Pandoc (setMeta "subtitle" (toMetaValue subtitle) nullMeta) mempty
101 in Pandoc (setMeta "subtitle" (toMetaValue subtitle) nullMeta) mempty
102
102
103 , "Keywords" =:
103 , "Keywords" =:
104− T.unlines [ "#+KEYWORDS: pandoc, testing,"
104+ T.unlines [ "#+keywords: pandoc, testing,"
105− , "#+KEYWORDS: Org"
105+ , "#+keywords: Org"
106 ] =?>
106 ] =?>
107 let keywords = toList $ "pandoc, testing," <> softbreak <> "Org"
107 let keywords = toList $ "pandoc, testing," <> softbreak <> "Org"
108 meta = setMeta "keywords" (MetaInlines keywords) nullMeta
108 meta = setMeta "keywords" (MetaInlines keywords) nullMeta
109 in Pandoc meta mempty
109 in Pandoc meta mempty
110
110
111 , "Institute" =:
111 , "Institute" =:
112− "#+INSTITUTE: ACME Inc." =?>
112+ "#+institute: ACME Inc." =?>
113 Pandoc (setMeta "institute" ("ACME Inc." :: Inlines) nullMeta) mempty
113 Pandoc (setMeta "institute" ("ACME Inc." :: Inlines) nullMeta) mempty
114
114
115 , testGroup "LaTeX"
115 , testGroup "LaTeX"
116 [ "LATEX_HEADER" =:
116 [ "LATEX_HEADER" =:
117− "#+LaTeX_header: \\usepackage{tikz}" =?>
117+ "#+latex_header: \\usepackage{tikz}" =?>
118 let latexInlines = rawInline "latex" "\\usepackage{tikz}"
118 let latexInlines = rawInline "latex" "\\usepackage{tikz}"
119 inclList = MetaList [MetaInlines (toList latexInlines)]
119 inclList = MetaList [MetaInlines (toList latexInlines)]
120 meta = setMeta "header-includes" inclList nullMeta
120 meta = setMeta "header-includes" inclList nullMeta
121 in Pandoc meta mempty
121 in Pandoc meta mempty
122
122
123 , "LATEX_HEADER_EXTRA" =:
123 , "LATEX_HEADER_EXTRA" =:
124− "#+LATEX_HEADER_EXTRA: \\usepackage{calc}" =?>
124+ "#+latex_header_extra: \\usepackage{calc}" =?>
125 let latexInlines = rawInline "latex" "\\usepackage{calc}"
125 let latexInlines = rawInline "latex" "\\usepackage{calc}"
126 inclList = toMetaValue [latexInlines]
126 inclList = toMetaValue [latexInlines]
127 in Pandoc (setMeta "header-includes" inclList nullMeta) mempty
127 in Pandoc (setMeta "header-includes" inclList nullMeta) mempty
128
128
129 , testGroup "LaTeX_CLASS"
129 , testGroup "LaTeX_CLASS"
130 [ "stored as documentclass" =:
130 [ "stored as documentclass" =:
131− "#+LATEX_CLASS: article" =?>
131+ "#+latex_class: article" =?>
132 let meta = setMeta "documentclass" (MetaString "article") nullMeta
132 let meta = setMeta "documentclass" (MetaString "article") nullMeta
133 in Pandoc meta mempty
133 in Pandoc meta mempty
134
134
135 , "last definition takes precedence" =:
135 , "last definition takes precedence" =:
136− T.unlines [ "#+LATEX_CLASS: this will not be used"
136+ T.unlines [ "#+latex_class: this will not be used"
137− , "#+LATEX_CLASS: report"
137+ , "#+latex_class: report"
138 ] =?>
138 ] =?>
139 let meta = setMeta "documentclass" (MetaString "report") nullMeta
139 let meta = setMeta "documentclass" (MetaString "report") nullMeta
140 in Pandoc meta mempty
140 in Pandoc meta mempty
141 ]
141 ]
142
142
143 , "LATEX_CLASS_OPTIONS as classoption" =:
143 , "LATEX_CLASS_OPTIONS as classoption" =:
144− "#+LATEX_CLASS_OPTIONS: [a4paper]" =?>
144+ "#+latex_class_options: [a4paper]" =?>
145 let meta = setMeta "classoption" (MetaString "a4paper") nullMeta
145 let meta = setMeta "classoption" (MetaString "a4paper") nullMeta
146 in Pandoc meta mempty
146 in Pandoc meta mempty
147 ]
147 ]
@@ -155,8 +155,8 @@ tests =
155 in Pandoc meta mempty
155 in Pandoc meta mempty
156
156
157 , "HTML_HEAD_EXTRA behaves like HTML_HEAD" =:
157 , "HTML_HEAD_EXTRA behaves like HTML_HEAD" =:
158− T.unlines [ "#+HTML_HEAD: <meta name=\"generator\" content=\"pandoc\">"
158+ T.unlines [ "#+html_head: <meta name=\"generator\" content=\"pandoc\">"
159− , "#+HTML_HEAD_EXTRA: <meta charset=\"utf-8\">"
159+ , "#+html_head_extra: <meta charset=\"utf-8\">"
160 ] =?>
160 ] =?>
161 let generator = rawInline "html"
161 let generator = rawInline "html"
162 "<meta name=\"generator\" content=\"pandoc\">"
162 "<meta name=\"generator\" content=\"pandoc\">"
@@ -167,9 +167,9 @@ tests =
167 ]
167 ]
168
168
169 , testGroup "Non-export keywords"
169 , testGroup "Non-export keywords"
170− [ testGroup "#+LINK"
170+ [ testGroup "#+link"
171 [ "Link abbreviation" =:
171 [ "Link abbreviation" =:
172− T.unlines [ "#+LINK: wp https://en.wikipedia.org/wiki/%s"
172+ T.unlines [ "#+link: wp https://en.wikipedia.org/wiki/%s"
173 , "[[wp:Org_mode][Wikipedia on Org-mode]]"
173 , "[[wp:Org_mode][Wikipedia on Org-mode]]"
174 ] =?>
174 ] =?>
175 para (link "https://en.wikipedia.org/wiki/Org_mode" ""
175 para (link "https://en.wikipedia.org/wiki/Org_mode" ""
@@ -177,7 +177,7 @@ tests =
177
177
178 , "Link abbreviation, defined after first use" =:
178 , "Link abbreviation, defined after first use" =:
179 T.unlines [ "[[zl:non-sense][Non-sense articles]]"
179 T.unlines [ "[[zl:non-sense][Non-sense articles]]"
180− , "#+LINK: zl http://zeitlens.com/tags/%s.html"
180+ , "#+link: zl http://zeitlens.com/tags/%s.html"
181 ] =?>
181 ] =?>
182 para (link "http://zeitlens.com/tags/non-sense.html" ""
182 para (link "http://zeitlens.com/tags/non-sense.html" ""
183 ("Non-sense" <> space <> "articles"))
183 ("Non-sense" <> space <> "articles"))
@@ -214,11 +214,11 @@ tests =
214 ]
214 ]
215
215
216 , "Unknown keyword" =:
216 , "Unknown keyword" =:
217− T.unlines [ "#+UNKNOWN_KEYWORD: Chumbawamba"
217+ T.unlines [ "#+unknown_keyword: Chumbawamba"
218− , "#+ANOTHER_UNKNOWN: Blur"
218+ , "#+another_unknown: Blur"
219 ] =?>
219 ] =?>
220− rawBlock "org" "#+UNKNOWN_KEYWORD: Chumbawamba" <>
220+ rawBlock "org" "#+unknown_keyword: Chumbawamba" <>
221− rawBlock "org" "#+ANOTHER_UNKNOWN: Blur"
221+ rawBlock "org" "#+another_unknown: Blur"
222 ]
222 ]
223
223
224 , "Properties drawer" =:
224 , "Properties drawer" =:
test/command/3706.md+8−8
@@ -2,12 +2,12 @@ Results marker can be hidden in block attributes (#3706)
2
2
3```
3```
4pandoc -f org -t native
4pandoc -f org -t native
5−#+BEGIN_SRC R :exports results :colnames yes
5+#+begin_src r :exports results :colnames yes
6 data.frame(Id = 1:3, Desc = rep("La",3))
6 data.frame(Id = 1:3, Desc = rep("La",3))
7−#+END_SRC
7+#+end_src
8
8
9−#+CAPTION: Lalelu.
9+#+caption: Lalelu.
10−#+LABEL: tab
10+#+label: tab
11#+RESULTS:
11#+RESULTS:
12| Id | Desc |
12| Id | Desc |
13|----+------|
13|----+------|
@@ -49,12 +49,12 @@ pandoc -f org -t native
49
49
50```
50```
51pandoc -f org -t native
51pandoc -f org -t native
52−#+BEGIN_SRC R :exports none :colnames yes
52+#+begin_src R :exports none :colnames yes
53 data.frame(Id = 1:2, Desc = rep("La",2))
53 data.frame(Id = 1:2, Desc = rep("La",2))
54−#+END_SRC
54+#+end_src
55
55
56−#+CAPTION: Lalelu.
56+#+caption: Lalelu.
57−#+LABEL: tab
57+#+label: tab
58#+RESULTS:
58#+RESULTS:
59| Id | Desc |
59| Id | Desc |
60|----+------|
60|----+------|
test/command/4186.md+8−8
@@ -1,8 +1,8 @@
1```
1```
2% pandoc -f org -t native
2% pandoc -f org -t native
3−#+BEGIN_EXAMPLE -i
3+#+begin_example -i
4 This should retain the four leading spaces
4 This should retain the four leading spaces
5−#+END_EXAMPLE
5+#+end_example
6^D
6^D
7[CodeBlock ("",["example"],[]) " This should retain the four leading spaces\n"]
7[CodeBlock ("",["example"],[]) " This should retain the four leading spaces\n"]
8```
8```
@@ -10,10 +10,10 @@
10```
10```
11% pandoc -f org -t html
11% pandoc -f org -t html
12- depth 1
12- depth 1
13− #+NAME: bob
13+ #+name: bob
14− #+BEGIN_EXAMPLE -i
14+ #+begin_example -i
15 Vertical alignment is four spaces beyond the appearance of the word "depth".
15 Vertical alignment is four spaces beyond the appearance of the word "depth".
16− #+END_EXAMPLE
16+ #+end_example
17 - depth 2
17 - depth 2
18 #+begin_example
18 #+begin_example
19 Vertically aligned with the second appearance of the word "depth".
19 Vertically aligned with the second appearance of the word "depth".
@@ -27,10 +27,10 @@
27 inner list element.
27 inner list element.
28 #+end_example
28 #+end_example
29 Still inside the inner list element
29 Still inside the inner list element
30− #+NAME: carrie
30+ #+name: carrie
31− #+BEGIN_EXAMPLE
31+ #+begin_example
32 This belongs to the outer list element, and is aligned accordingly, since the NAME attribute is not indented deeply enough. It is not enough for the BEGIN alone to be aligned deeply if the block is meant to have a NAME.
32 This belongs to the outer list element, and is aligned accordingly, since the NAME attribute is not indented deeply enough. It is not enough for the BEGIN alone to be aligned deeply if the block is meant to have a NAME.
33− #+END_EXAMPLE
33+ #+end_example
34 Still in the shallower list element since the preceding example
34 Still in the shallower list element since the preceding example
35 block forced the deeper list element to terminate.
35 block forced the deeper list element to terminate.
36Outside all lists.
36Outside all lists.
test/command/5178.md+10−10
@@ -6,21 +6,21 @@
6 main = putStrLn "Hello World!"
6 main = putStrLn "Hello World!"
7 unsafePerformIO main
7 unsafePerformIO main
8^D
8^D
9−#+BEGIN_SRC haskell -n 42
9+#+begin_src haskell -n 42
10 main = putStrLn "Hello World!"
10 main = putStrLn "Hello World!"
11 unsafePerformIO main
11 unsafePerformIO main
12−#+END_SRC
12+#+end_src
13```
13```
14
14
15```
15```
16% pandoc -f org -t native
16% pandoc -f org -t native
17−#+BEGIN_SRC lisp -n 20
17+#+begin_src lisp -n 20
18 (+ 1 1)
18 (+ 1 1)
19−#+END_SRC
19+#+end_src
20
20
21−#+BEGIN_SRC lisp +n 10
21+#+begin_src lisp +n 10
22 (+ 2 2)
22 (+ 2 2)
23−#+END_SRC
23+#+end_src
24^D
24^D
25[CodeBlock ("",["commonlisp","numberLines"],[("org-language","lisp"),("startFrom","20")]) "(+ 1 1)\n"
25[CodeBlock ("",["commonlisp","numberLines"],[("org-language","lisp"),("startFrom","20")]) "(+ 1 1)\n"
26,CodeBlock ("",["commonlisp","numberLines","continuedSourceBlock"],[("org-language","lisp"),("startFrom","10")]) "(+ 2 2)\n"]
26,CodeBlock ("",["commonlisp","numberLines","continuedSourceBlock"],[("org-language","lisp"),("startFrom","10")]) "(+ 2 2)\n"]
@@ -31,11 +31,11 @@
31[CodeBlock ("",["commonlisp","numberLines"],[("org-language","lisp"),("startFrom","20")]) "(+ 1 1)\n"
31[CodeBlock ("",["commonlisp","numberLines"],[("org-language","lisp"),("startFrom","20")]) "(+ 1 1)\n"
32,CodeBlock ("",["commonlisp","numberLines","continuedSourceBlock"],[("org-language","lisp"),("startFrom","10")]) "(+ 2 2)\n"]
32,CodeBlock ("",["commonlisp","numberLines","continuedSourceBlock"],[("org-language","lisp"),("startFrom","10")]) "(+ 2 2)\n"]
33^D
33^D
34−#+BEGIN_SRC lisp -n 20
34+#+begin_src lisp -n 20
35 (+ 1 1)
35 (+ 1 1)
36−#+END_SRC
36+#+end_src
37
37
38−#+BEGIN_SRC lisp +n 10
38+#+begin_src lisp +n 10
39 (+ 2 2)
39 (+ 2 2)
40−#+END_SRC
40+#+end_src
41```
41```
test/org-select-tags.org+2−2
@@ -1,5 +1,5 @@
1−#+SELECT_TAGS: yes no
1+#+select_tags: yes no
2−#+EXCLUDE_TAGS: no
2+#+exclude_tags: no
3
3
4In a document containing one or more trees containing a tag
4In a document containing one or more trees containing a tag
5listed in SELECT_TAGS, only those trees and their ancestor nodes will appear;
5listed in SELECT_TAGS, only those trees and their ancestor nodes will appear;
test/tables.org+3−3
@@ -5,7 +5,7 @@ Simple table with caption:
5| 12 | 12 | 12 | 12 |
5| 12 | 12 | 12 | 12 |
6| 123 | 123 | 123 | 123 |
6| 123 | 123 | 123 | 123 |
7| 1 | 1 | 1 | 1 |
7| 1 | 1 | 1 | 1 |
8−#+CAPTION: Demonstration of simple table syntax.
8+#+caption: Demonstration of simple table syntax.
9
9
10Simple table without caption:
10Simple table without caption:
11
11
@@ -22,7 +22,7 @@ Simple table indented two spaces:
22| 12 | 12 | 12 | 12 |
22| 12 | 12 | 12 | 12 |
23| 123 | 123 | 123 | 123 |
23| 123 | 123 | 123 | 123 |
24| 1 | 1 | 1 | 1 |
24| 1 | 1 | 1 | 1 |
25−#+CAPTION: Demonstration of simple table syntax.
25+#+caption: Demonstration of simple table syntax.
26
26
27Multiline table with caption:
27Multiline table with caption:
28
28
@@ -30,7 +30,7 @@ Multiline table with caption:
30|-----------------+--------------+---------------+-------------------------------------------------------|
30|-----------------+--------------+---------------+-------------------------------------------------------|
31| First | row | 12.0 | Example of a row that spans multiple lines. |
31| First | row | 12.0 | Example of a row that spans multiple lines. |
32| Second | row | 5.0 | Here's another one. Note the blank line between rows. |
32| Second | row | 5.0 | Here's another one. Note the blank line between rows. |
33−#+CAPTION: Here's the caption. It may span multiple lines.
33+#+caption: Here's the caption. It may span multiple lines.
34
34
35Multiline table without caption:
35Multiline table without caption:
36
36
test/writer.org+84−84
@@ -1,7 +1,7 @@
1−#+TITLE: Pandoc Test Suite
1+#+title: Pandoc Test Suite
2
2
3−#+AUTHOR: John MacFarlane; Anonymous
3+#+author: John MacFarlane; Anonymous
4−#+DATE: July 17, 2006
4+#+date: July 17, 2006
5
5
6This is a set of tests for pandoc. Most of them are adapted from John Gruber's
6This is a set of tests for pandoc. Most of them are adapted from John Gruber's
7markdown test suite.
7markdown test suite.
@@ -73,18 +73,18 @@ here.
73 :END:
73 :END:
74E-mail style:
74E-mail style:
75
75
76−#+BEGIN_QUOTE
76+#+begin_quote
77 This is a block quote. It is pretty short.
77 This is a block quote. It is pretty short.
78−#+END_QUOTE
78+#+end_quote
79
79
80−#+BEGIN_QUOTE
80+#+begin_quote
81 Code in a block quote:
81 Code in a block quote:
82
82
83− #+BEGIN_EXAMPLE
83+ #+begin_example
84 sub status {
84 sub status {
85 print "working";
85 print "working";
86 }
86 }
87− #+END_EXAMPLE
87+ #+end_example
88
88
89 A list:
89 A list:
90
90
@@ -93,14 +93,14 @@ E-mail style:
93
93
94 Nested block quotes:
94 Nested block quotes:
95
95
96− #+BEGIN_QUOTE
96+ #+begin_quote
97 nested
97 nested
98− #+END_QUOTE
98+ #+end_quote
99
99
100− #+BEGIN_QUOTE
100+ #+begin_quote
101 nested
101 nested
102− #+END_QUOTE
102+ #+end_quote
103−#+END_QUOTE
103+#+end_quote
104
104
105This should not be a block quote: 2 > 1.
105This should not be a block quote: 2 > 1.
106
106
@@ -114,7 +114,7 @@ And a following paragraph.
114 :END:
114 :END:
115Code:
115Code:
116
116
117−#+BEGIN_EXAMPLE
117+#+begin_example
118 ---- (should be four hyphens)
118 ---- (should be four hyphens)
119
119
120 sub status {
120 sub status {
@@ -122,15 +122,15 @@ Code:
122 }
122 }
123
123
124 this code block is indented by one tab
124 this code block is indented by one tab
125−#+END_EXAMPLE
125+#+end_example
126
126
127And:
127And:
128
128
129−#+BEGIN_EXAMPLE
129+#+begin_example
130 this code block is indented by two tabs
130 this code block is indented by two tabs
131
131
132 These should not be escaped: \$ \\ \> \[ \{
132 These should not be escaped: \$ \\ \> \[ \{
133−#+END_EXAMPLE
133+#+end_example
134
134
135--------------
135--------------
136
136
@@ -347,13 +347,13 @@ Multiple blocks with italics:
347
347
348- /orange/ :: orange fruit
348- /orange/ :: orange fruit
349
349
350− #+BEGIN_EXAMPLE
350+ #+begin_example
351 { orange code block }
351 { orange code block }
352− #+END_EXAMPLE
352+ #+end_example
353
353
354− #+BEGIN_QUOTE
354+ #+begin_quote
355 orange block quote
355 orange block quote
356− #+END_QUOTE
356+ #+end_quote
357
357
358Multiple definitions, tight:
358Multiple definitions, tight:
359
359
@@ -399,45 +399,45 @@ bar
399
399
400Interpreted markdown in a table:
400Interpreted markdown in a table:
401
401
402−#+BEGIN_HTML
402+#+begin_html
403 <table>
403 <table>
404−#+END_HTML
404+#+end_html
405
405
406−#+BEGIN_HTML
406+#+begin_html
407 <tr>
407 <tr>
408−#+END_HTML
408+#+end_html
409
409
410−#+BEGIN_HTML
410+#+begin_html
411 <td>
411 <td>
412−#+END_HTML
412+#+end_html
413
413
414This is /emphasized/
414This is /emphasized/
415
415
416−#+BEGIN_HTML
416+#+begin_html
417 </td>
417 </td>
418−#+END_HTML
418+#+end_html
419
419
420−#+BEGIN_HTML
420+#+begin_html
421 <td>
421 <td>
422−#+END_HTML
422+#+end_html
423
423
424And this is *strong*
424And this is *strong*
425
425
426−#+BEGIN_HTML
426+#+begin_html
427 </td>
427 </td>
428−#+END_HTML
428+#+end_html
429
429
430−#+BEGIN_HTML
430+#+begin_html
431 </tr>
431 </tr>
432−#+END_HTML
432+#+end_html
433
433
434−#+BEGIN_HTML
434+#+begin_html
435 </table>
435 </table>
436−#+END_HTML
436+#+end_html
437
437
438−#+BEGIN_HTML
438+#+begin_html
439 <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
439 <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
440−#+END_HTML
440+#+end_html
441
441
442Here's a simple block:
442Here's a simple block:
443
443
@@ -445,17 +445,17 @@ foo
445
445
446This should be a code block, though:
446This should be a code block, though:
447
447
448−#+BEGIN_EXAMPLE
448+#+begin_example
449 <div>
449 <div>
450 foo
450 foo
451 </div>
451 </div>
452−#+END_EXAMPLE
452+#+end_example
453
453
454As should this:
454As should this:
455
455
456−#+BEGIN_EXAMPLE
456+#+begin_example
457 <div>foo</div>
457 <div>foo</div>
458−#+END_EXAMPLE
458+#+end_example
459
459
460Now, nested:
460Now, nested:
461
461
@@ -463,80 +463,80 @@ foo
463
463
464This should just be an HTML comment:
464This should just be an HTML comment:
465
465
466−#+BEGIN_HTML
466+#+begin_html
467 <!-- Comment -->
467 <!-- Comment -->
468−#+END_HTML
468+#+end_html
469
469
470Multiline:
470Multiline:
471
471
472−#+BEGIN_HTML
472+#+begin_html
473 <!--
473 <!--
474 Blah
474 Blah
475 Blah
475 Blah
476 -->
476 -->
477−#+END_HTML
477+#+end_html
478
478
479−#+BEGIN_HTML
479+#+begin_html
480 <!--
480 <!--
481 This is another comment.
481 This is another comment.
482 -->
482 -->
483−#+END_HTML
483+#+end_html
484
484
485Code block:
485Code block:
486
486
487−#+BEGIN_EXAMPLE
487+#+begin_example
488 <!-- Comment -->
488 <!-- Comment -->
489−#+END_EXAMPLE
489+#+end_example
490
490
491Just plain comment, with trailing spaces on the line:
491Just plain comment, with trailing spaces on the line:
492
492
493−#+BEGIN_HTML
493+#+begin_html
494 <!-- foo -->
494 <!-- foo -->
495−#+END_HTML
495+#+end_html
496
496
497Code:
497Code:
498
498
499−#+BEGIN_EXAMPLE
499+#+begin_example
500 <hr />
500 <hr />
501−#+END_EXAMPLE
501+#+end_example
502
502
503Hr's:
503Hr's:
504
504
505−#+BEGIN_HTML
505+#+begin_html
506 <hr>
506 <hr>
507−#+END_HTML
507+#+end_html
508
508
509−#+BEGIN_HTML
509+#+begin_html
510 <hr />
510 <hr />
511−#+END_HTML
511+#+end_html
512
512
513−#+BEGIN_HTML
513+#+begin_html
514 <hr />
514 <hr />
515−#+END_HTML
515+#+end_html
516
516
517−#+BEGIN_HTML
517+#+begin_html
518 <hr>
518 <hr>
519−#+END_HTML
519+#+end_html
520
520
521−#+BEGIN_HTML
521+#+begin_html
522 <hr />
522 <hr />
523−#+END_HTML
523+#+end_html
524
524
525−#+BEGIN_HTML
525+#+begin_html
526 <hr />
526 <hr />
527−#+END_HTML
527+#+end_html
528
528
529−#+BEGIN_HTML
529+#+begin_html
530 <hr class="foo" id="bar" />
530 <hr class="foo" id="bar" />
531−#+END_HTML
531+#+end_html
532
532
533−#+BEGIN_HTML
533+#+begin_html
534 <hr class="foo" id="bar" />
534 <hr class="foo" id="bar" />
535−#+END_HTML
535+#+end_html
536
536
537−#+BEGIN_HTML
537+#+begin_html
538 <hr class="foo" id="bar">
538 <hr class="foo" id="bar">
539−#+END_HTML
539+#+end_html
540
540
541--------------
541--------------
542
542
@@ -727,9 +727,9 @@ Indented [[/url][thrice]].
727
727
728This should [not][] be a link.
728This should [not][] be a link.
729
729
730−#+BEGIN_EXAMPLE
730+#+begin_example
731 [not]: /url
731 [not]: /url
732−#+END_EXAMPLE
732+#+end_example
733
733
734Foo [[/url/][bar]].
734Foo [[/url/][bar]].
735
735
@@ -760,15 +760,15 @@ With an ampersand: [[http://example.com/?foo=1&bar=2]]
760
760
761An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
761An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
762
762
763−#+BEGIN_QUOTE
763+#+begin_quote
764 Blockquoted: [[http://example.com/]]
764 Blockquoted: [[http://example.com/]]
765−#+END_QUOTE
765+#+end_quote
766
766
767Auto-links should not occur here: =<http://example.com/>=
767Auto-links should not occur here: =<http://example.com/>=
768
768
769−#+BEGIN_EXAMPLE
769+#+begin_example
770 or here: <http://example.com/>
770 or here: <http://example.com/>
771−#+END_EXAMPLE
771+#+end_example
772
772
773--------------
773--------------
774
774
@@ -778,7 +778,7 @@ Auto-links should not occur here: =<http://example.com/>=
778 :END:
778 :END:
779From "Voyage dans la Lune" by Georges Melies (1902):
779From "Voyage dans la Lune" by Georges Melies (1902):
780
780
781−#+CAPTION: lalune
781+#+caption: lalune
782[[file:lalune.jpg]]
782[[file:lalune.jpg]]
783
783
784Here is a movie [[file:movie.jpg]] icon.
784Here is a movie [[file:movie.jpg]] icon.
@@ -793,9 +793,9 @@ Here is a footnote reference,[fn:1] and another.[fn:2] This should /not/ be a
793footnote reference, because it contains a space.[^my note] Here is an inline
793footnote reference, because it contains a space.[^my note] Here is an inline
794note.[fn:3]
794note.[fn:3]
795
795
796−#+BEGIN_QUOTE
796+#+begin_quote
797 Notes can go in quotes.[fn:4]
797 Notes can go in quotes.[fn:4]
798−#+END_QUOTE
798+#+end_quote
799
799
8001. And in list items.[fn:5]
8001. And in list items.[fn:5]
801
801
@@ -809,9 +809,9 @@ This paragraph should not be part of the note, as it is not indented.
809 Subsequent blocks are indented to show that they belong to the footnote
809 Subsequent blocks are indented to show that they belong to the footnote
810 (as with list items).
810 (as with list items).
811
811
812− #+BEGIN_EXAMPLE
812+ #+begin_example
813 { <code> }
813 { <code> }
814− #+END_EXAMPLE
814+ #+end_example
815
815
816 If you want, you can indent every line, but you can also be lazy and
816 If you want, you can indent every line, but you can also be lazy and
817 just indent the first line of each block.
817 just indent the first line of each block.