pandoc 1.10.0.5 → 1.10.1
raw patch · 28 files changed
+182/−83 lines, 28 filesdep ~ansi-terminaldep ~old-timePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: ansi-terminal, old-time
API changes (from Hackage documentation)
- Text.Pandoc.Parsing: macro :: Parser [Char] ParserState Block
+ Text.Pandoc.Parsing: macro :: Parser [Char] ParserState Blocks
Files
- changelog +50/−0
- man/make-pandoc-man-pages.hs +4/−1
- pandoc.cabal +3/−3
- src/Text/Pandoc/Parsing.hs +17/−5
- src/Text/Pandoc/Readers/LaTeX.hs +1/−1
- src/Text/Pandoc/Readers/Markdown.hs +28/−27
- src/Text/Pandoc/Readers/MediaWiki.hs +4/−4
- src/Text/Pandoc/Readers/RST.hs +7/−5
- src/Text/Pandoc/Writers/Docbook.hs +1/−1
- src/Text/Pandoc/Writers/LaTeX.hs +3/−1
- src/Text/Pandoc/Writers/Markdown.hs +6/−3
- src/Text/Pandoc/Writers/RST.hs +6/−1
- tests/lhs-test-markdown.native +1/−1
- tests/lhs-test.html +2/−2
- tests/lhs-test.html+lhs +2/−2
- tests/lhs-test.latex +2/−2
- tests/lhs-test.latex+lhs +2/−2
- tests/lhs-test.markdown +2/−2
- tests/lhs-test.markdown+lhs +2/−2
- tests/lhs-test.native +1/−1
- tests/lhs-test.rst +3/−3
- tests/lhs-test.rst+lhs +2/−2
- tests/markdown-reader-more.native +7/−1
- tests/markdown-reader-more.txt +10/−3
- tests/mediawiki-reader.native +4/−0
- tests/mediawiki-reader.wiki +3/−0
- tests/tables.latex +7/−7
- tests/writer.docbook +2/−1
changelog view
@@ -1,3 +1,53 @@+pandoc (1.10.1)++ * Markdown reader: various optimizations, leading to a+ significant performance boost.++ * RST reader: Allow anonymous form of inline links:+ `` `hello <url>`__ `` Closes #724.++ * Mediawiki reader: Don't require newlines after tables.+ Thanks to jrunningen for the patch. Closes #733.++ * Fixed LaTeX macro parsing. Now LaTeX macro definitions are preserved+ when output is LaTeX, and applied when it is another format.+ Partially addresses #730.++ * Markdown and RST readers: Added parser to `block` that skips blank+ lines. This fixes a subtle regression involving grid tables with+ empty cells. Also added test for grid table with empty cells.+ Closes #732.++ * RST writer: Use `.. code:: language` for code blocks with language.+ Closes #721.++ * DocBook writer: Fixed output for hard line breaks, adding a newline+ between `<literallayout>` tags.++ * Markdown writer: Use an autolink when link text matches url.+ Previously we also checked for a null title, but this+ test fails for links produced by citeproc-hs in bibliographies.+ So, if the link has a title, it will be lost on conversion+ to an autolink, but that seems okay.++ * Markdown writer: Set title, author, date variables as before.+ These are no longer used in the default template, since we use+ titleblock, but we set them anyway for those who use custom templates.++ * LaTeX writer: Avoid extra space at start/end of table cell.+ Thanks to Nick Bart for the suggestion of using @{}.++ * `Text.Pandoc.Parsing`:+ + + More efficient version of `anyLine`.+ + Type of `macro` has changed; the parser now returns `Blocks`+ instead of `Block`.++ * Relaxed old-time version bound, allowing 1.0.*.++ * Removed obsolete `hsmarkdown` script. Those who need `hsmarkdown`+ should create a symlink as described in the README.+ pandoc (1.10.0.5) * Markdown reader: Try `lhsCodeBlock` before `rawTeXBlock`. Otherwise
man/make-pandoc-man-pages.hs view
@@ -7,11 +7,14 @@ import System.Environment (getArgs) import Text.Pandoc.Shared (normalize) import Data.Maybe ( catMaybes )-import Data.Time.Clock (UTCTime(..)) import Prelude hiding (catch) import Control.Exception ( catch ) import System.IO.Error ( isDoesNotExistError )+#if MIN_VERSION_directory(1,2,0)+import Data.Time.Clock (UTCTime(..))+#else import System.Time (ClockTime(..))+#endif import System.Directory main :: IO ()
pandoc.cabal view
@@ -1,5 +1,5 @@ Name: pandoc-Version: 1.10.0.5+Version: 1.10.1 Cabal-Version: >= 1.10 Build-Type: Custom License: GPL@@ -357,7 +357,7 @@ base >= 4.2 && < 5, directory >= 1 && < 1.3, filepath >= 1.1 && < 1.4,- old-time >= 1.1 && < 1.2,+ old-time >= 1.0 && < 1.2, time >= 1.2 && < 1.5 Default-Language: Haskell98 Default-Extensions: CPP@@ -382,7 +382,7 @@ QuickCheck >= 2.4 && < 2.6, HUnit >= 1.2 && < 1.3, containers >= 0.1 && < 0.6,- ansi-terminal == 0.5.*+ ansi-terminal >= 0.5 && < 0.7 Other-Modules: Tests.Old Tests.Helpers Tests.Arbitrary
src/Text/Pandoc/Parsing.hs view
@@ -148,7 +148,7 @@ import Text.Pandoc.Definition import Text.Pandoc.Options-import Text.Pandoc.Builder (Blocks, Inlines)+import Text.Pandoc.Builder (Blocks, Inlines, rawBlock) import qualified Text.Pandoc.UTF8 as UTF8 (putStrLn) import Text.Parsec import Text.Parsec.Pos (newPos)@@ -190,7 +190,19 @@ -- | Parse any line of text anyLine :: Parser [Char] st [Char]-anyLine = manyTill anyChar newline+anyLine = do+ -- This is much faster than:+ -- manyTill anyChar newline+ inp <- getInput+ pos <- getPosition+ case break (=='\n') inp of+ (this, '\n':rest) -> do+ -- needed to persuade parsec that this won't match an empty string:+ anyChar+ setInput rest+ setPosition $ incSourceLine (setSourceColumn pos 1) 1+ return this+ _ -> mzero -- | Like @manyTill@, but reads at least one item. many1Till :: Parser [tok] st a@@ -995,7 +1007,7 @@ -- -- | Parse a \newcommand or \renewcommand macro definition.-macro :: Parser [Char] ParserState Block+macro :: Parser [Char] ParserState Blocks macro = do apply <- getOption readerApplyMacros inp <- getInput@@ -1006,8 +1018,8 @@ then do updateState $ \st -> st { stateMacros = ms ++ stateMacros st }- return Null- else return $ RawBlock "latex" def'+ return mempty+ else return $ rawBlock "latex" def' -- | Apply current macros to string. applyMacros' :: String -> Parser [Char] ParserState String
src/Text/Pandoc/Readers/LaTeX.hs view
@@ -204,7 +204,7 @@ block = (mempty <$ comment) <|> (mempty <$ ((spaceChar <|> newline) *> spaces)) <|> environment- <|> mempty <$ macro+ <|> macro <|> blockCommand <|> paragraph <|> grouped block
src/Text/Pandoc/Readers/Markdown.hs view
@@ -19,7 +19,7 @@ {- | Module : Text.Pandoc.Readers.Markdown- Copyright : Copyright (C) 2006-2010 John MacFarlane+ Copyright : Copyright (C) 2006-2013 John MacFarlane License : GNU GPL, version 2 or above Maintainer : John MacFarlane <jgm@berkeley.edu>@@ -355,7 +355,7 @@ block :: MarkdownParser (F Blocks) block = choice [ codeBlockFenced- , guardEnabled Ext_latex_macros *> (mempty <$ macro)+ , guardEnabled Ext_latex_macros *> (macro >>= return . return) , header , lhsCodeBlock , rawTeXBlock@@ -373,6 +373,7 @@ , abbrevKey , para , plain+ , mempty <$ blanklines ] <?> "block" --@@ -463,7 +464,7 @@ -- indentedLine :: MarkdownParser String-indentedLine = indentSpaces >> manyTill anyChar newline >>= return . (++ "\n")+indentedLine = indentSpaces >> anyLine >>= return . (++ "\n") blockDelimiter :: (Char -> Bool) -> Maybe Int@@ -581,7 +582,7 @@ char c -- allow html tags on left margin: when (c == '<') $ notFollowedBy letter- manyTill anyChar newline+ anyLine -- -- block quotes@@ -681,7 +682,7 @@ notFollowedBy blankline notFollowedBy' listStart optional indentSpaces- result <- manyTill anyChar newline+ result <- anyLine return $ result ++ "\n" listItem :: MarkdownParser a@@ -736,7 +737,6 @@ definitionListItem :: MarkdownParser (F (Inlines, [Blocks])) definitionListItem = try $ do- guardEnabled Ext_definition_lists -- first, see if this has any chance of being a definition list: lookAhead (anyLine >> optional blankline >> defListMarker) term <- trimInlinesF . mconcat <$> manyTill inline newline@@ -763,6 +763,7 @@ definitionList :: MarkdownParser (F Blocks) definitionList = do+ guardEnabled Ext_definition_lists items <- fmap sequence $ many1 definitionListItem return $ B.definitionList <$> fmap compactify'DL items @@ -807,7 +808,7 @@ _ -> return $ B.para result' plain :: MarkdownParser (F Blocks)-plain = fmap B.plain . trimInlinesF . mconcat <$> many1 inline <* spaces+plain = fmap B.plain . trimInlinesF . mconcat <$> many1 inline -- -- raw html@@ -1041,7 +1042,7 @@ let aligns = zipWith alignType rawHeadsList lengths let rawHeads = if headless then replicate (length dashes) ""- else map (intercalate " ") rawHeadsList+ else map unwords rawHeadsList heads <- fmap sequence $ mapM (parseFromString (mconcat <$> many plain)) $ map trim rawHeads@@ -1098,10 +1099,9 @@ -- RST does not have a notion of alignments let rawHeads = if headless then replicate (length dashes) ""- else map (intercalate " ") $ transpose+ else map unwords $ transpose $ map (gridTableSplitLine indices) rawContent- heads <- fmap sequence $ mapM (parseFromString parseBlocks) $- map trim rawHeads+ heads <- fmap sequence $ mapM (parseFromString parseBlocks . trim) rawHeads return (heads, aligns, indices) gridTableRawLine :: [Int] -> MarkdownParser [String]@@ -1186,7 +1186,11 @@ -- Succeed only if current line contains a pipe. scanForPipe :: Parser [Char] st ()-scanForPipe = lookAhead (manyTill (satisfy (/='\n')) (char '|')) >> return ()+scanForPipe = do+ inp <- getInput+ case break (\c -> c == '\n' || c == '|') inp of+ (_,'|':_) -> return ()+ _ -> mzero -- | Parse a table using 'headerParser', 'rowParser', -- 'lineParser', and 'footerParser'. Variant of the version in@@ -1378,8 +1382,14 @@ (inlinesBetween starStart starEnd <|> inlinesBetween ulStart ulEnd) where starStart = char '*' >> lookAhead nonspaceChar starEnd = notFollowedBy' (() <$ strong) >> char '*'- ulStart = char '_' >> lookAhead nonspaceChar+ ulStart = checkIntraword >> char '_' >> lookAhead nonspaceChar ulEnd = notFollowedBy' (() <$ strong) >> char '_'+ checkIntraword = do+ exts <- getOption readerExtensions+ when (Ext_intraword_underscores `Set.member` exts) $ do+ pos <- getPosition+ lastStrPos <- stateLastStrPos <$> getState+ guard $ lastStrPos /= Just pos strong :: MarkdownParser (F Inlines) strong = fmap B.strong <$> nested@@ -1418,20 +1428,11 @@ str :: MarkdownParser (F Inlines) str = do- isSmart <- readerSmart . stateOptions <$> getState- a <- alphaNum- as <- many $ alphaNum- <|> (guardEnabled Ext_intraword_underscores >>- try (char '_' >>~ lookAhead alphaNum))- <|> if isSmart- then (try $ satisfy (\c -> c == '\'' || c == '\x2019') >>- lookAhead alphaNum >> return '\x2019')- -- for things like l'aide- else mzero+ result <- many1 alphaNum pos <- getPosition updateState $ \s -> s{ stateLastStrPos = Just pos }- let result = a:as let spacesToNbr = map (\c -> if c == ' ' then '\160' else c)+ isSmart <- getOption readerSmart if isSmart then case likelyAbbrev result of [] -> return $ return $ B.str result@@ -1615,9 +1616,9 @@ guardEnabled Ext_raw_html mdInHtml <- option False $ guardEnabled Ext_markdown_in_html_blocks >> return True- (_,result) <- if mdInHtml- then htmlTag isInlineTag- else htmlTag (not . isTextTag)+ (_,result) <- htmlTag $ if mdInHtml+ then isInlineTag+ else not . isTextTag return $ return $ B.rawInline "html" result -- Citations
src/Text/Pandoc/Readers/MediaWiki.hs view
@@ -180,7 +180,7 @@ table :: MWParser Blocks table = do tableStart- styles <- manyTill anyChar newline+ styles <- anyLine let tableWidth = case lookup "width" $ parseAttrs styles of Just w -> maybe 1.0 id $ parseWidth w Nothing -> 1.0@@ -222,7 +222,7 @@ tableStart = try $ guardColumnOne *> sym "{|" tableEnd :: MWParser ()-tableEnd = try $ guardColumnOne *> sym "|}" <* blanklines+tableEnd = try $ guardColumnOne *> sym "|}" rowsep :: MWParser () rowsep = try $ guardColumnOne *> sym "|-" <* blanklines@@ -242,7 +242,7 @@ guardColumnOne sym "|+" skipMany spaceChar- res <- manyTill anyChar newline >>= parseFromString (many inline)+ res <- anyLine >>= parseFromString (many inline) return $ trimInlines $ mconcat res tableRow :: MWParser [((Alignment, Double), Blocks)]@@ -375,7 +375,7 @@ return (terms, defs) defListTerm :: MWParser Inlines-defListTerm = char ';' >> skipMany spaceChar >> manyTill anyChar newline >>=+defListTerm = char ';' >> skipMany spaceChar >> anyLine >>= parseFromString (trimInlines . mconcat <$> many inline) listStart :: Char -> MWParser ()
src/Text/Pandoc/Readers/RST.hs view
@@ -143,6 +143,7 @@ , list , lhsCodeBlock , para+ , mempty <$ blanklines ] <?> "block" --@@ -155,7 +156,7 @@ char ':' name <- many1Till (noneOf "\n") (char ':') (() <$ lookAhead newline) <|> skipMany1 spaceChar- first <- manyTill anyChar newline+ first <- anyLine rest <- option "" $ try $ do lookAhead (string indent >> spaceChar) indentedBlock let raw = (if null first then "" else (first ++ "\n")) ++ rest ++ "\n"@@ -302,7 +303,7 @@ indentedLine :: String -> Parser [Char] st [Char] indentedLine indents = try $ do string indents- manyTill anyChar newline+ anyLine -- one or more indented lines, possibly separated by blank lines. -- any amount of indentation will work.@@ -339,7 +340,7 @@ $ intercalate "\n" lns' birdTrackLine :: Parser [Char] st [Char]-birdTrackLine = char '>' >> manyTill anyChar newline+birdTrackLine = char '>' >> anyLine -- -- block quotes@@ -394,7 +395,7 @@ listLine markerLength = try $ do notFollowedBy blankline indentWith markerLength- line <- manyTill anyChar newline+ line <- anyLine return $ line ++ "\n" -- indent by specified number of spaces (or equiv. tabs)@@ -411,7 +412,7 @@ -> RSTParser (Int, [Char]) rawListItem start = try $ do markerLength <- start- firstLine <- manyTill anyChar newline+ firstLine <- anyLine restLines <- many (listLine markerLength) return (markerLength, (firstLine ++ "\n" ++ (concat restLines))) @@ -962,6 +963,7 @@ src <- manyTill (noneOf ">\n") (char '>') skipSpaces string "`_"+ optional $ char '_' -- anonymous form return $ B.link (escapeURI $ trim src) "" label' referenceLink :: RSTParser Inlines
src/Text/Pandoc/Writers/Docbook.hs view
@@ -282,7 +282,7 @@ fixNS = everywhere (mkT fixNS') inlineToDocbook _ (RawInline f x) | f == "html" || f == "docbook" = text x | otherwise = empty-inlineToDocbook _ LineBreak = inTagsSimple "literallayout" empty+inlineToDocbook _ LineBreak = flush $ inTagsSimple "literallayout" (text "\n") inlineToDocbook _ Space = space inlineToDocbook opts (Link txt (src, _)) = if isPrefixOf "mailto:" src
src/Text/Pandoc/Writers/LaTeX.hs view
@@ -422,7 +422,9 @@ let notes = vcat $ map toNote tableNotes let colDescriptors = text $ concat $ map toColDescriptor aligns modify $ \s -> s{ stTable = True, stInTable = False, stTableNotes = [] }- return $ "\\begin{longtable}[c]" <> braces colDescriptors+ return $ "\\begin{longtable}[c]" <>+ braces ("@{}" <> colDescriptors <> "@{}")+ -- the @{} removes extra space at beginning and end $$ "\\hline\\noalign{\\medskip}" $$ headers $$ vcat rows'
src/Text/Pandoc/Writers/Markdown.hs view
@@ -141,7 +141,10 @@ let context = writerVariables opts ++ [ ("toc", render colwidth toc) , ("body", main)+ , ("title", render Nothing title')+ , ("date", render Nothing date') ] +++ [ ("author", render Nothing a) | a <- authors' ] ++ [ ("titleblock", render colwidth titleblock) | not (null title && null authors && null date) ] if writerStandalone opts@@ -644,9 +647,9 @@ then empty else text $ " \"" ++ tit ++ "\"" let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src- let useAuto = case (tit,txt) of- ("", [Str s]) | escapeURI s == srcSuffix -> True- _ -> False+ let useAuto = case txt of+ [Str s] | escapeURI s == srcSuffix -> True+ _ -> False let useRefLinks = writerReferenceLinks opts && not useAuto ref <- if useRefLinks then getReference txt (src, tit) else return [] reftext <- inlineListToMarkdown opts ref
src/Text/Pandoc/Writers/RST.hs view
@@ -177,7 +177,12 @@ if "haskell" `elem` classes && "literate" `elem` classes && isEnabled Ext_literate_haskell opts then return $ prefixed "> " (text str) $$ blankline- else return $ "::" $+$ nest tabstop (text str) $$ blankline+ else return $+ (case [c | c <- classes,+ c `notElem` ["sourceCode","literate","numberLines"]] of+ [] -> "::"+ (lang:_) -> ".. code:: " <> text lang)+ $+$ nest tabstop (text str) $$ blankline blockToRST (BlockQuote blocks) = do tabstop <- get >>= (return . writerTabStop . stOptions) contents <- blockListToRST blocks
tests/lhs-test-markdown.native view
@@ -1,6 +1,6 @@ [Header 1 ("lhs-test",[],[]) [Str "lhs",Space,Str "test"] ,Para [Code ("",[],[]) "unsplit",Space,Str "is",Space,Str "an",Space,Str "arrow",Space,Str "that",Space,Str "takes",Space,Str "a",Space,Str "pair",Space,Str "of",Space,Str "values",Space,Str "and",Space,Str "combines",Space,Str "them",Space,Str "to",Space,Str "return",Space,Str "a",Space,Str "single",Space,Str "value:"]-,CodeBlock ("",["sourceCode","literate","haskell"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry \n -- arr (\\op (x,y) -> x `op` y) "+,CodeBlock ("",["sourceCode","literate","haskell"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" ,Para [Code ("",[],[]) "(***)",Space,Str "combines",Space,Str "two",Space,Str "arrows",Space,Str "into",Space,Str "a",Space,Str "new",Space,Str "arrow",Space,Str "by",Space,Str "running",Space,Str "the",Space,Str "two",Space,Str "arrows",Space,Str "on",Space,Str "a",Space,Str "pair",Space,Str "of",Space,Str "values",Space,Str "(one",Space,Str "arrow",Space,Str "on",Space,Str "the",Space,Str "first",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair",Space,Str "and",Space,Str "one",Space,Str "arrow",Space,Str "on",Space,Str "the",Space,Str "second",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair)."] ,CodeBlock ("",[],[]) "f *** g = first f >>> second g" ,Para [Str "Block",Space,Str "quote:"]
tests/lhs-test.html view
@@ -30,8 +30,8 @@ <h1>lhs test</h1> <p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p> <pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="ot">unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=></span> (b <span class="ot">-></span> c <span class="ot">-></span> d) <span class="ot">-></span> a (b, c) d-unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span> - <span class="co">-- arr (\op (x,y) -> x `op` y) </span></code></pre>+unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span>+ <span class="co">-- arr (\op (x,y) -> x `op` y)</span></code></pre> <p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p> <pre><code>f *** g = first f >>> second g</code></pre> <p>Block quote:</p>
tests/lhs-test.html+lhs view
@@ -30,8 +30,8 @@ <h1>lhs test</h1> <p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p> <pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="fu">></span><span class="ot"> unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=></span> (b <span class="ot">-></span> c <span class="ot">-></span> d) <span class="ot">-></span> a (b, c) d-<span class="fu">></span> unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span> -<span class="fu">></span> <span class="co">-- arr (\op (x,y) -> x `op` y) </span></code></pre>+<span class="fu">></span> unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span>+<span class="fu">></span> <span class="co">-- arr (\op (x,y) -> x `op` y)</span></code></pre> <p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p> <pre><code>f *** g = first f >>> second g</code></pre> <p>Block quote:</p>
tests/lhs-test.latex view
@@ -72,8 +72,8 @@ \begin{Shaded} \begin{Highlighting}[] \OtherTok{unsplit ::} \NormalTok{(}\DataTypeTok{Arrow} \NormalTok{a) }\OtherTok{=>} \NormalTok{(b }\OtherTok{->} \NormalTok{c }\OtherTok{->} \NormalTok{d) }\OtherTok{->} \NormalTok{a (b, c) d}-\NormalTok{unsplit }\FunctionTok{=} \NormalTok{arr }\FunctionTok{.} \FunctionTok{uncurry} - \CommentTok{-- arr (\textbackslash{}op (x,y) -> x `op` y) }+\NormalTok{unsplit }\FunctionTok{=} \NormalTok{arr }\FunctionTok{.} \FunctionTok{uncurry}+ \CommentTok{-- arr (\textbackslash{}op (x,y) -> x `op` y)} \end{Highlighting} \end{Shaded}
tests/lhs-test.latex+lhs view
@@ -53,8 +53,8 @@ \begin{code} unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d-unsplit = arr . uncurry - -- arr (\op (x,y) -> x `op` y) +unsplit = arr . uncurry+ -- arr (\op (x,y) -> x `op` y) \end{code} \texttt{(***)} combines two arrows into a new arrow by running the two arrows
tests/lhs-test.markdown view
@@ -6,8 +6,8 @@ ~~~~ {.sourceCode .literate .haskell} unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d-unsplit = arr . uncurry - -- arr (\op (x,y) -> x `op` y) +unsplit = arr . uncurry+ -- arr (\op (x,y) -> x `op` y) ~~~~ `(***)` combines two arrows into a new arrow by running the two arrows on a
tests/lhs-test.markdown+lhs view
@@ -5,8 +5,8 @@ a single value: > unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d-> unsplit = arr . uncurry -> -- arr (\op (x,y) -> x `op` y) +> unsplit = arr . uncurry+> -- arr (\op (x,y) -> x `op` y) `(***)` combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the
tests/lhs-test.native view
@@ -1,6 +1,6 @@ [Header 1 ("",[],[]) [Str "lhs",Space,Str "test"] ,Para [Code ("",[],[]) "unsplit",Space,Str "is",Space,Str "an",Space,Str "arrow",Space,Str "that",Space,Str "takes",Space,Str "a",Space,Str "pair",Space,Str "of",Space,Str "values",Space,Str "and",Space,Str "combines",Space,Str "them",Space,Str "to",Space,Str "return",Space,Str "a",Space,Str "single",Space,Str "value:"]-,CodeBlock ("",["sourceCode","literate","haskell"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry \n -- arr (\\op (x,y) -> x `op` y) "+,CodeBlock ("",["sourceCode","literate","haskell"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" ,Para [Code ("",[],[]) "(***)",Space,Str "combines",Space,Str "two",Space,Str "arrows",Space,Str "into",Space,Str "a",Space,Str "new",Space,Str "arrow",Space,Str "by",Space,Str "running",Space,Str "the",Space,Str "two",Space,Str "arrows",Space,Str "on",Space,Str "a",Space,Str "pair",Space,Str "of",Space,Str "values",Space,Str "(one",Space,Str "arrow",Space,Str "on",Space,Str "the",Space,Str "first",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair",Space,Str "and",Space,Str "one",Space,Str "arrow",Space,Str "on",Space,Str "the",Space,Str "second",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair)."] ,CodeBlock ("",[],[]) "f *** g = first f >>> second g" ,Para [Str "Block",Space,Str "quote:"]
tests/lhs-test.rst view
@@ -4,11 +4,11 @@ ``unsplit`` is an arrow that takes a pair of values and combines them to return a single value: -::+.. code:: haskell unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d- unsplit = arr . uncurry - -- arr (\op (x,y) -> x `op` y) + unsplit = arr . uncurry+ -- arr (\op (x,y) -> x `op` y) ``(***)`` combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the
tests/lhs-test.rst+lhs view
@@ -5,8 +5,8 @@ return a single value: > unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d-> unsplit = arr . uncurry -> -- arr (\op (x,y) -> x `op` y) +> unsplit = arr . uncurry+> -- arr (\op (x,y) -> x `op` y) ``(***)`` combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the
tests/markdown-reader-more.native view
@@ -118,4 +118,10 @@ [[Plain [Str "b"]] ,[Plain [Str "b",Space,Str "2"]] ,[Plain [Str "b",Space,Str "2"]]]]- ,[Para [Str "c",Space,Str "c",Space,Str "2",Space,Str "c",Space,Str "2"]]]]]+ ,[Para [Str "c",Space,Str "c",Space,Str "2",Space,Str "c",Space,Str "2"]]]]+,Para [Str "Empty",Space,Str "cells"]+,Table [] [AlignDefault,AlignDefault] [5.555555555555555e-2,5.555555555555555e-2]+ [[]+ ,[]]+ [[[]+ ,[]]]]
tests/markdown-reader-more.txt view
@@ -196,8 +196,15 @@ +------------------+-----------+------------+ | # col 1 | # col 2 | # col 3 | | col 1 | col 2 | col 3 |-+------------------+-----------+------------+ ++------------------+-----------+------------+ | r1 a | - b | c |-| | - b 2 | c 2 | -| r1 bis | - b 2 | c 2 | +| | - b 2 | c 2 |+| r1 bis | - b 2 | c 2 | +------------------+-----------+------------+++Empty cells+++---+---++| | |++---+---++
tests/mediawiki-reader.native view
@@ -237,5 +237,9 @@ ,[Para [Str "ice",Space,Str "cream"]]]]]] ,[[Para [Str "Butter"]] ,[Para [Str "Ice",Space,Str "cream"]]]]+,Table [] [AlignDefault] [0.0]+ [[]]+ [[[Para [Str "Orange"]]]]+,Para [Str "Paragraph",Space,Str "after",Space,Str "the",Space,Str "table."] ,Header 2 ("",[],[]) [Str "notes"] ,Para [Str "My",Space,Str "note!",Note [Plain [Str "This."]]]]
tests/mediawiki-reader.wiki view
@@ -362,6 +362,9 @@ |Ice cream |} +{|+|Orange+|}Paragraph after the table. == notes ==
tests/tables.latex view
@@ -1,6 +1,6 @@ Simple table with caption: -\begin{longtable}[c]{rlcl}+\begin{longtable}[c]{@{}rlcl@{}} \hline\noalign{\medskip} Right & Left & Center & Default \\\noalign{\medskip}@@ -18,7 +18,7 @@ Simple table without caption: -\begin{longtable}[c]{rlcl}+\begin{longtable}[c]{@{}rlcl@{}} \hline\noalign{\medskip} Right & Left & Center & Default \\\noalign{\medskip}@@ -34,7 +34,7 @@ Simple table indented two spaces: -\begin{longtable}[c]{rlcl}+\begin{longtable}[c]{@{}rlcl@{}} \hline\noalign{\medskip} Right & Left & Center & Default \\\noalign{\medskip}@@ -52,7 +52,7 @@ Multiline table with caption: -\begin{longtable}[c]{clrl}+\begin{longtable}[c]{@{}clrl@{}} \hline\noalign{\medskip} \begin{minipage}[b]{0.15\columnwidth}\centering Centered Header@@ -92,7 +92,7 @@ Multiline table without caption: -\begin{longtable}[c]{clrl}+\begin{longtable}[c]{@{}clrl@{}} \hline\noalign{\medskip} \begin{minipage}[b]{0.15\columnwidth}\centering Centered Header@@ -130,7 +130,7 @@ Table without column headers: -\begin{longtable}[c]{rlcr}+\begin{longtable}[c]{@{}rlcr@{}} \hline\noalign{\medskip} 12 & 12 & 12 & 12 \\\noalign{\medskip}@@ -143,7 +143,7 @@ Multiline table without column headers: -\begin{longtable}[c]{clrl}+\begin{longtable}[c]{@{}clrl@{}} \hline\noalign{\medskip} \begin{minipage}[t]{0.15\columnwidth}\centering First
tests/writer.docbook view
@@ -67,7 +67,8 @@ Here’s one with a bullet. * criminey. </para> <para>- There should be a hard line break<literallayout></literallayout>here.+ There should be a hard line break<literallayout>+</literallayout>here. </para> </sect1> <sect1 id="block-quotes">