aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
m---------data/templates14
-rw-r--r--src/Text/Pandoc/Readers/Org.hs20
-rw-r--r--tests/Tests/Readers/Org.hs19
-rw-r--r--tests/s5-basic.html8
-rw-r--r--tests/s5-fancy.html8
-rw-r--r--tests/writer.asciidoc5
6 files changed, 54 insertions, 20 deletions
diff --git a/data/templates b/data/templates
-Subproject 06fe6706f1b0655185248cc0c1ee3d2e187ec07
+Subproject de2e524e7df0a9d4159f2794deaa2e1847c87d4
diff --git a/src/Text/Pandoc/Readers/Org.hs b/src/Text/Pandoc/Readers/Org.hs
index 9db0f2e65..2585ace21 100644
--- a/src/Text/Pandoc/Readers/Org.hs
+++ b/src/Text/Pandoc/Readers/Org.hs
@@ -532,10 +532,16 @@ rundocBlockClass :: String
rundocBlockClass = rundocPrefix ++ "block"
blockOption :: OrgParser (String, String)
-blockOption = try $ (,) <$> orgArgKey <*> orgParamValue
+blockOption = try $ do
+ argKey <- orgArgKey
+ paramValue <- option "yes" orgParamValue
+ return (argKey, paramValue)
inlineBlockOption :: OrgParser (String, String)
-inlineBlockOption = try $ (,) <$> orgArgKey <*> orgInlineParamValue
+inlineBlockOption = try $ do
+ argKey <- orgArgKey
+ paramValue <- option "yes" orgInlineParamValue
+ return (argKey, paramValue)
orgArgKey :: OrgParser String
orgArgKey = try $
@@ -544,11 +550,17 @@ orgArgKey = try $
orgParamValue :: OrgParser String
orgParamValue = try $
- skipSpaces *> many1 (noneOf "\t\n\r ") <* skipSpaces
+ skipSpaces
+ *> notFollowedBy (char ':' )
+ *> many1 (noneOf "\t\n\r ")
+ <* skipSpaces
orgInlineParamValue :: OrgParser String
orgInlineParamValue = try $
- skipSpaces *> many1 (noneOf "\t\n\r ]") <* skipSpaces
+ skipSpaces
+ *> notFollowedBy (char ':')
+ *> many1 (noneOf "\t\n\r ]")
+ <* skipSpaces
orgArgWordChar :: OrgParser Char
orgArgWordChar = alphaNum <|> oneOf "-_"
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index 2d23eaebf..66f284b28 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -264,6 +264,16 @@ tests =
)
"echo 'Hello, World'")
+ , "Inline code block with toggle" =:
+ "src_sh[:toggle]{echo $HOME}" =?>
+ (para $ codeWith ( ""
+ , [ "bash", "rundoc-block" ]
+ , [ ("rundoc-language", "sh")
+ , ("rundoc-toggle", "yes")
+ ]
+ )
+ "echo $HOME")
+
, "Citation" =:
"[@nonexistent]" =?>
let citation = Citation
@@ -1102,6 +1112,15 @@ tests =
, ": 65" ] =?>
rawBlock "html" ""
+ , "Source block with toggling header arguments" =:
+ unlines [ "#+BEGIN_SRC sh :noeval"
+ , "echo $HOME"
+ , "#+END_SRC"
+ ] =?>
+ let classes = [ "bash", "rundoc-block" ]
+ params = [ ("rundoc-language", "sh"), ("rundoc-noeval", "yes") ]
+ in codeBlockWith ("", classes, params) "echo $HOME\n"
+
, "Example block" =:
unlines [ "#+begin_example"
, "A chosen representation of"
diff --git a/tests/s5-basic.html b/tests/s5-basic.html
index ac153d0f1..6fb57e4aa 100644
--- a/tests/s5-basic.html
+++ b/tests/s5-basic.html
@@ -4,7 +4,9 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
+ <meta name="version" content="S5 1.1" />
<meta name="author" content="Sam Smith" />
+ <meta name="version" content="S5 1.1" />
<meta name="author" content="Jen Jones" />
<meta name="date" content="2006-07-15" />
<title>My S5 Document</title>
@@ -32,9 +34,9 @@
</div>
<div class="presentation">
<div class="titleslide slide">
- <h1>My S5 Document</h1>
- <h2>Sam Smith<br/>Jen Jones</h2>
- <h3>July 15, 2006</h3>
+ <h1 class="title">My S5 Document</h1>
+ <h3 class="author">Sam Smith<br/>Jen Jones</h3>
+ <h4 class="date">July 15, 2006</h4>
</div>
<div id="first-slide" class="slide section level1">
<h1>First slide</h1>
diff --git a/tests/s5-fancy.html b/tests/s5-fancy.html
index 818cca04a..3a2a602be 100644
--- a/tests/s5-fancy.html
+++ b/tests/s5-fancy.html
@@ -4,7 +4,9 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
+ <meta name="version" content="S5 1.1" />
<meta name="author" content="Sam Smith" />
+ <meta name="version" content="S5 1.1" />
<meta name="author" content="Jen Jones" />
<meta name="date" content="2006-07-15" />
<title>My S5 Document</title>
@@ -233,9 +235,9 @@
</div>
<div class="presentation">
<div class="titleslide slide">
- <h1>My S5 Document</h1>
- <h2>Sam Smith<br/>Jen Jones</h2>
- <h3>July 15, 2006</h3>
+ <h1 class="title">My S5 Document</h1>
+ <h3 class="author">Sam Smith<br/>Jen Jones</h3>
+ <h4 class="date">July 15, 2006</h4>
</div>
<div id="first-slide" class="slide section level1">
<h1>First slide</h1>
diff --git a/tests/writer.asciidoc b/tests/writer.asciidoc
index aebc529f0..83869df39 100644
--- a/tests/writer.asciidoc
+++ b/tests/writer.asciidoc
@@ -1,8 +1,7 @@
Pandoc Test Suite
=================
-:author: John MacFarlane
-:author: Anonymous
-:date: July 17, 2006
+John MacFarlane; Anonymous
+July 17, 2006
This is a set of tests for pandoc. Most of them are adapted from John Gruber’s
markdown test suite.