git.iko.soy/typeable/pandoc
on master help sign in
Add support for attributes in inline Code.

Additional related changes: * URLs in Code in autolinks now use class "url". * Require highlighting-kate 0.2.8.2, which omits the final <br/> tag, essential for inline code.

commitf8dca6ccbc4ce927ee035c3e60729c040b2280a0 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 26 Jan 2011, 20:44 (16 years ago) parent703c421
35 files changed+152−133
pandoc.cabal+2−2 src/Text/Pandoc/Parsing.hs+1−1 src/Text/Pandoc/Readers/HTML.hs+6−2 src/Text/Pandoc/Readers/LaTeX.hs+5−5 src/Text/Pandoc/Readers/Markdown.hs+3−2 src/Text/Pandoc/Readers/RST.hs+2−1 src/Text/Pandoc/Readers/TeXMath.hs+1−1 src/Text/Pandoc/Readers/Textile.hs+2−2 src/Text/Pandoc/Shared.hs+4−4 src/Text/Pandoc/Writers/ConTeXt.hs+3−3 src/Text/Pandoc/Writers/Docbook.hs+5−5 src/Text/Pandoc/Writers/HTML.hs+12−5 src/Text/Pandoc/Writers/LaTeX.hs+3−3 src/Text/Pandoc/Writers/Man.hs+5−4 src/Text/Pandoc/Writers/Markdown.hs+28−20 src/Text/Pandoc/Writers/MediaWiki.hs+7−7 src/Text/Pandoc/Writers/OpenDocument.hs+1−1 src/Text/Pandoc/Writers/Org.hs+2−2 src/Text/Pandoc/Writers/RST.hs+3−3 src/Text/Pandoc/Writers/RTF.hs+1−1 src/Text/Pandoc/Writers/Texinfo.hs+2−2 src/Text/Pandoc/Writers/Textile.hs+3−3 tests/Tests/Arbitrary.hs+1−1 tests/html-reader.native+5−5 tests/latex-reader.native+10−10 tests/lhs-test.fragment.html+lhs+1−2 tests/lhs-test.html+1−2 tests/lhs-test.html+lhs+1−2 tests/lhs-test.native+2−2 tests/markdown-reader-more.native+5−5 tests/rst-reader.native+1−1 tests/testsuite.native+10−10 tests/textile-reader.native+1−1 tests/writer.html+3−3 tests/writer.native+10−10
pandoc.cabal+2−2
@@ -211,7 +211,7 @@ Library
211211 else
212212 Build-depends: base >= 3 && < 4
213213 if flag(highlighting)
214− Build-depends: highlighting-kate >= 0.2.7.1 && < 0.2.9
214+ Build-depends: highlighting-kate >= 0.2.8.2 && < 0.2.9
215215 cpp-options: -D_HIGHLIGHTING
216216 if impl(ghc >= 6.12)
217217 Ghc-Options: -O2 -Wall -fno-warn-unused-do-bind
@@ -295,7 +295,7 @@ Executable pandoc
295295 else
296296 Build-depends: base >= 3 && < 4
297297 if flag(highlighting)
298− Build-depends: highlighting-kate >= 0.2.7.1 && < 0.2.9
298+ Build-depends: highlighting-kate >= 0.2.8.2 && < 0.2.9
299299 cpp-options: -D_HIGHLIGHTING
300300 if impl(ghc >= 6.12)
301301 Ghc-Options: -O2 -Wall -fno-warn-unused-do-bind
src/Text/Pandoc/Parsing.hs+1−1
@@ -664,7 +664,7 @@ toKey = Key . bottomUp lowercase
664664 where lowercase :: Inline -> Inline
665665 lowercase (Str xs) = Str (map toLower xs)
666666 lowercase (Math t xs) = Math t (map toLower xs)
667− lowercase (Code xs) = Code (map toLower xs)
667+ lowercase (Code attr xs) = Code attr (map toLower xs)
668668 lowercase (RawInline f xs) = RawInline f (map toLower xs)
669669 lowercase LineBreak = Space
670670 lowercase x = x
src/Text/Pandoc/Readers/HTML.hs+6−2
@@ -338,9 +338,13 @@ pImage = do
338338
339339pCode :: TagParser [Inline]
340340pCode = try $ do
341− (TagOpen open _) <- pSatisfy $ tagOpen (`elem` ["code","tt"]) (const True)
341+ (TagOpen open attr) <- pSatisfy $ tagOpen (`elem` ["code","tt"]) (const True)
342342 result <- manyTill pAnyTag (pCloses open)
343− return [Code $ intercalate " " $ lines $ innerText result]
343+ let ident = fromMaybe "" $ lookup "id" attr
344+ let classes = words $ fromMaybe [] $ lookup "class" attr
345+ let rest = filter (\(x,_) -> x /= "id" && x /= "class") attr
346+ return [Code (ident,classes,rest)
347+ $ intercalate " " $ lines $ innerText result]
344348
345349pRawHtmlInline :: TagParser [Inline]
346350pRawHtmlInline = do
src/Text/Pandoc/Readers/LaTeX.hs+5−5
@@ -710,27 +710,27 @@ code1 = try $ do
710710 string "\\verb"
711711 marker <- anyChar
712712 result <- manyTill anyChar (char marker)
713− return $ Code $ removeLeadingTrailingSpace result
713+ return $ Code nullAttr $ removeLeadingTrailingSpace result
714714
715715code2 :: GenParser Char st Inline
716716code2 = try $ do
717717 string "\\texttt{"
718718 result <- manyTill (noneOf "\\\n~$%^&{}") (char '}')
719− return $ Code result
719+ return $ Code nullAttr result
720720
721721code3 :: GenParser Char st Inline
722722code3 = try $ do
723723 string "\\lstinline"
724724 marker <- anyChar
725725 result <- manyTill anyChar (char marker)
726− return $ Code $ removeLeadingTrailingSpace result
726+ return $ Code nullAttr $ removeLeadingTrailingSpace result
727727
728728lhsInlineCode :: GenParser Char ParserState Inline
729729lhsInlineCode = try $ do
730730 failUnlessLHS
731731 char '|'
732732 result <- manyTill (noneOf "|\n") (char '|')
733− return $ Code result
733+ return $ Code ("",["haskell"],[]) result
734734
735735emph :: GenParser Char ParserState Inline
736736emph = try $ oneOfStrings [ "\\emph{", "\\textit{" ] >>
@@ -861,7 +861,7 @@ url :: GenParser Char ParserState Inline
861861url = try $ do
862862 string "\\url"
863863 url' <- charsInBalanced '{' '}'
864− return $ Link [Code url'] (escapeURI url', "")
864+ return $ Link [Code ("",["url"],[]) url'] (escapeURI url', "")
865865
866866link :: GenParser Char ParserState Inline
867867link = try $ do
src/Text/Pandoc/Readers/Markdown.hs+3−2
@@ -977,7 +977,8 @@ code = try $ do
977977 (char '\n' >> notFollowedBy' blankline >> return " "))
978978 (try (skipSpaces >> count (length starts) (char '`') >>
979979 notFollowedBy (char '`')))
980− return $ Code $ removeLeadingTrailingSpace $ concat result
980+ attr <- option ([],[],[]) (try $ optional whitespace >> attributes)
981+ return $ Code attr $ removeLeadingTrailingSpace $ concat result
981982
982983mathWord :: GenParser Char st [Char]
983984mathWord = liftM concat $ many1 mathChunk
@@ -1163,7 +1164,7 @@ autoLink = try $ do
11631164 st <- getState
11641165 return $ if stateStrict st
11651166 then Link [Str orig] (src, "")
1166− else Link [Code orig] (src, "")
1167+ else Link [Code ("",["url"],[]) orig] (src, "")
11671168
11681169image :: GenParser Char ParserState Inline
11691170image = try $ do
src/Text/Pandoc/Readers/RST.hs+2−1
@@ -746,7 +746,8 @@ code :: GenParser Char ParserState Inline
746746code = try $ do
747747 string "``"
748748 result <- manyTill anyChar (try (string "``"))
749− return $ Code $ removeLeadingTrailingSpace $ intercalate " " $ lines result
749+ return $ Code nullAttr
750+ $ removeLeadingTrailingSpace $ intercalate " " $ lines result
750751
751752emph :: GenParser Char ParserState Inline
752753emph = enclosed (char '*') (char '*') inline >>=
src/Text/Pandoc/Readers/TeXMath.hs+1−1
@@ -90,7 +90,7 @@ expToInlines (EUp x y) = expToInlines (ESuper x y)
9090expToInlines (EDownup x y z) = expToInlines (ESubsup x y z)
9191expToInlines (EText "normal" x) = Just [Str x]
9292expToInlines (EText "bold" x) = Just [Strong [Str x]]
93−expToInlines (EText "monospace" x) = Just [Code x]
93+expToInlines (EText "monospace" x) = Just [Code nullAttr x]
9494expToInlines (EText "italic" x) = Just [Emph [Str x]]
9595expToInlines (EText _ x) = Just [Str x]
9696expToInlines (EOver (EGrouped [EIdentifier [c]]) (ESymbol Accent [accent])) =
src/Text/Pandoc/Readers/Textile.hs+2−2
@@ -494,13 +494,13 @@ code :: GenParser Char ParserState Inline
494494code = code1 <|> code2
495495
496496code1 :: GenParser Char ParserState Inline
497−code1 = surrounded (char '@') anyChar >>= return . Code
497+code1 = surrounded (char '@') anyChar >>= return . Code nullAttr
498498
499499code2 :: GenParser Char ParserState Inline
500500code2 = do
501501 htmlTag (tagOpen (=="tt") null)
502502 result' <- manyTill anyChar (try $ htmlTag $ tagClose (=="tt"))
503− return $ Code result'
503+ return $ Code nullAttr result'
504504
505505-- | Html / CSS attributes
506506attributes :: GenParser Char ParserState String
src/Text/Pandoc/Shared.hs+4−4
@@ -279,7 +279,7 @@ removeEmptyInlines (Superscript [] : zs) = removeEmptyInlines zs
279279removeEmptyInlines (SmallCaps [] : zs) = removeEmptyInlines zs
280280removeEmptyInlines (Strikeout [] : zs) = removeEmptyInlines zs
281281removeEmptyInlines (RawInline _ [] : zs) = removeEmptyInlines zs
282−removeEmptyInlines (Code [] : zs) = removeEmptyInlines zs
282+removeEmptyInlines (Code _ [] : zs) = removeEmptyInlines zs
283283removeEmptyInlines (x : xs) = x : removeEmptyInlines xs
284284removeEmptyInlines [] = []
285285
@@ -312,8 +312,8 @@ consolidateInlines (Strikeout xs : Strikeout ys : zs) = consolidateInlines $
312312 Strikeout (xs ++ ys) : zs
313313consolidateInlines (RawInline f x : RawInline f' y : zs) | f == f' =
314314 consolidateInlines $ RawInline f (x ++ y) : zs
315−consolidateInlines (Code x : Code y : zs) = consolidateInlines $
316− Code (x ++ y) : zs
315+consolidateInlines (Code a1 x : Code a2 y : zs) | a1 == a2 =
316+ consolidateInlines $ Code a1 (x ++ y) : zs
317317consolidateInlines (x : xs) = x : consolidateInlines xs
318318consolidateInlines [] = []
319319
@@ -323,7 +323,7 @@ stringify = queryWith go
323323 where go :: Inline -> [Char]
324324 go Space = " "
325325 go (Str x) = x
326− go (Code x) = x
326+ go (Code _ x) = x
327327 go (Math _ x) = x
328328 go EmDash = "--"
329329 go EnDash = "-"
src/Text/Pandoc/Writers/ConTeXt.hs+3−3
@@ -245,9 +245,9 @@ inlineToConTeXt (Subscript lst) = do
245245inlineToConTeXt (SmallCaps lst) = do
246246 contents <- inlineListToConTeXt lst
247247 return $ braces $ "\\sc " <> contents
248−inlineToConTeXt (Code str) | not ('{' `elem` str || '}' `elem` str) =
248+inlineToConTeXt (Code _ str) | not ('{' `elem` str || '}' `elem` str) =
249249 return $ "\\type" <> braces (text str)
250−inlineToConTeXt (Code str) =
250+inlineToConTeXt (Code _ str) =
251251 return $ "\\mono" <> braces (text $ stringToConTeXt str)
252252inlineToConTeXt (Quoted SingleQuote lst) = do
253253 contents <- inlineListToConTeXt lst
@@ -270,7 +270,7 @@ inlineToConTeXt (RawInline "tex" str) = return $ text str
270270inlineToConTeXt (RawInline _ _) = return empty
271271inlineToConTeXt (LineBreak) = return $ text "\\crlf" <> cr
272272inlineToConTeXt Space = return space
273−inlineToConTeXt (Link [Code str] (src, tit)) = -- since ConTeXt has its own
273+inlineToConTeXt (Link [Code _ str] (src, tit)) = -- since ConTeXt has its own
274274 inlineToConTeXt (Link [Str str] (src, tit)) -- way of printing links...
275275inlineToConTeXt (Link txt (src, _)) = do
276276 st <- get
src/Text/Pandoc/Writers/Docbook.hs+5−5
@@ -258,7 +258,7 @@ inlineToDocbook _ Apostrophe = char '\''
258258inlineToDocbook _ Ellipses = text "…"
259259inlineToDocbook _ EmDash = text "—"
260260inlineToDocbook _ EnDash = text "–"
261−inlineToDocbook _ (Code str) =
261+inlineToDocbook _ (Code _ str) =
262262 inTagsSimple "literal" $ text (escapeStringForXML str)
263263inlineToDocbook opts (Math _ str) = inlinesToDocbook opts $ readTeXMath str
264264inlineToDocbook _ (RawInline _ _) = empty
@@ -269,10 +269,10 @@ inlineToDocbook opts (Link txt (src, _)) =
269269 then let src' = drop 7 src
270270 emailLink = inTagsSimple "email" $ text $
271271 escapeStringForXML $ src'
272− in if txt == [Code src']
273− then emailLink
274− else inlinesToDocbook opts txt <+> char '(' <> emailLink <>
275− char ')'
272+ in case txt of
273+ [Code _ s] | s == src' -> emailLink
274+ _ -> inlinesToDocbook opts txt <+>
275+ char '(' <> emailLink <> char ')'
276276 else (if isPrefixOf "#" src
277277 then inTags False "link" [("linkend", drop 1 src)]
278278 else inTags False "ulink" [("url", src)]) $
src/Text/Pandoc/Writers/HTML.hs+12−5
@@ -298,6 +298,12 @@ obfuscateChar char =
298298obfuscateString :: String -> String
299299obfuscateString = concatMap obfuscateChar . decodeCharacterReferences
300300
301+attrsToHtml :: WriterOptions -> Attr -> [HtmlAttr]
302+attrsToHtml opts (id',classes',keyvals) =
303+ [theclass (unwords classes') | not (null classes')] ++
304+ [prefixedId opts id' | not (null id')] ++
305+ map (\(x,y) -> strAttr x y) keyvals
306+
301307-- | Convert Pandoc block element to HTML.
302308blockToHtml :: WriterOptions -> Block -> State WriterState Html
303309blockToHtml _ Null = return $ noHtml
@@ -322,9 +328,7 @@ blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do
322328 Left _ -> -- change leading newlines into <br /> tags, because some
323329 -- browsers ignore leading newlines in pre blocks
324330 let (leadingBreaks, rawCode') = span (=='\n') rawCode
325− attrs = [theclass (unwords classes') | not (null classes')] ++
326− [prefixedId opts id' | not (null id')] ++
327− map (\(x,y) -> strAttr x y) keyvals
331+ attrs = attrsToHtml opts (id', classes', keyvals)
328332 addBird = if "literate" `elem` classes'
329333 then unlines . map ("> " ++) . lines
330334 else unlines . lines
@@ -479,7 +483,10 @@ inlineToHtml opts inline =
479483 (Apostrophe) -> return $ stringToHtml "’"
480484 (Emph lst) -> inlineListToHtml opts lst >>= return . emphasize
481485 (Strong lst) -> inlineListToHtml opts lst >>= return . strong
482− (Code str) -> return $ thecode << str
486+ (Code attr str) -> return $ thecode ! (attrsToHtml opts attr) << str'
487+ where str' = case highlightHtml attr str of
488+ Left _ -> stringToHtml str
489+ Right h -> h
483490 (Strikeout lst) -> inlineListToHtml opts lst >>=
484491 return . (thespan ! [thestyle "text-decoration: line-through;"])
485492 (SmallCaps lst) -> inlineListToHtml opts lst >>=
@@ -547,7 +554,7 @@ inlineToHtml opts inline =
547554 _ -> return noHtml
548555 (RawInline "html" str) -> return $ primHtml str
549556 (RawInline _ _) -> return noHtml
550− (Link [Code str] (s,_)) | "mailto:" `isPrefixOf` s ->
557+ (Link [Code _ str] (s,_)) | "mailto:" `isPrefixOf` s ->
551558 return $ obfuscateLink opts str s
552559 (Link txt (s,_)) | "mailto:" `isPrefixOf` s -> do
553560 linkText <- inlineListToHtml opts txt
src/Text/Pandoc/Writers/LaTeX.hs+3−3
@@ -150,7 +150,7 @@ inCmd cmd contents = char '\\' <> text cmd <> braces contents
150150-- (because it's illegal to have verbatim inside some command arguments)
151151deVerb :: [Inline] -> [Inline]
152152deVerb [] = []
153−deVerb ((Code str):rest) =
153+deVerb ((Code _ str):rest) =
154154 (RawInline "latex" $ "\\texttt{" ++ stringToLaTeX str ++ "}"):(deVerb rest)
155155deVerb (other:rest) = other:(deVerb rest)
156156
@@ -331,7 +331,7 @@ inlineToLaTeX (Cite cits lst) = do
331331 Biblatex -> citationsToBiblatex cits
332332 _ -> inlineListToLaTeX lst
333333
334−inlineToLaTeX (Code str) = do
334+inlineToLaTeX (Code _ str) = do
335335 st <- get
336336 when (stInNote st) $ modify $ \s -> s{ stVerbInNote = True }
337337 let chr = ((enumFromTo '!' '~') \\ str) !! 0
@@ -368,7 +368,7 @@ inlineToLaTeX (LineBreak) = return "\\\\"
368368inlineToLaTeX Space = return space
369369inlineToLaTeX (Link txt (src, _)) =
370370 case txt of
371− [Code x] | x == src -> -- autolink
371+ [Code _ x] | x == src -> -- autolink
372372 do modify $ \s -> s{ stUrl = True }
373373 return $ text $ "\\url{" ++ x ++ "}"
374374 _ -> do contents <- inlineListToLaTeX $ deVerb txt
src/Text/Pandoc/Writers/Man.hs+5−4
@@ -307,7 +307,7 @@ inlineToMan _ EmDash = return $ text "\\[em]"
307307inlineToMan _ EnDash = return $ text "\\[en]"
308308inlineToMan _ Apostrophe = return $ char '\''
309309inlineToMan _ Ellipses = return $ text "\\&..."
310−inlineToMan _ (Code str) =
310+inlineToMan _ (Code _ str) =
311311 return $ text $ "\\f[C]" ++ escapeCode str ++ "\\f[]"
312312inlineToMan _ (Str str) = return $ text $ escapeString str
313313inlineToMan opts (Math InlineMath str) = inlineListToMan opts $ readTeXMath str
@@ -322,9 +322,10 @@ inlineToMan _ Space = return space
322322inlineToMan opts (Link txt (src, _)) = do
323323 linktext <- inlineListToMan opts txt
324324 let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
325− return $ if txt == [Code srcSuffix]
326− then char '<' <> text srcSuffix <> char '>'
327− else linktext <> text " (" <> text src <> char ')'
325+ return $ case txt of
326+ [Code _ s]
327+ | s == srcSuffix -> char '<' <> text srcSuffix <> char '>'
328+ _ -> linktext <> text " (" <> text src <> char ')'
328329inlineToMan opts (Image alternate (source, tit)) = do
329330 let txt = if (null alternate) || (alternate == [Str ""]) ||
330331 (alternate == [Str source]) -- to prevent autolinks
src/Text/Pandoc/Writers/Markdown.hs+28−20
@@ -73,7 +73,7 @@ plainify = bottomUp go
7373 go (Superscript xs) = SmallCaps xs
7474 go (Subscript xs) = SmallCaps xs
7575 go (SmallCaps xs) = SmallCaps xs
76− go (Code s) = Str s
76+ go (Code _ s) = Str s
7777 go (Math _ s) = Str s
7878 go (RawInline _ _) = Str ""
7979 go (Link xs _) = SmallCaps xs
@@ -171,6 +171,22 @@ elementToListItem (Sec _ _ _ headerText subsecs) = [Plain headerText] ++
171171 then []
172172 else [BulletList $ map elementToListItem subsecs]
173173
174+attrsToMarkdown :: Attr -> Doc
175+attrsToMarkdown attribs = braces $ hsep [attribId, attribClasses, attribKeys]
176+ where attribId = case attribs of
177+ ([],_,_) -> empty
178+ (i,_,_) -> "#" <> text i
179+ attribClasses = case attribs of
180+ (_,[],_) -> empty
181+ (_,cs,_) -> hsep $
182+ map (text . ('.':))
183+ cs
184+ attribKeys = case attribs of
185+ (_,_,[]) -> empty
186+ (_,_,ks) -> hsep $
187+ map (\(k,v) -> text k
188+ <> "=\"" <> text v <> "\"") ks
189+
174190-- | Ordered list start parser for use in Para below.
175191olMarker :: GenParser Char ParserState Char
176192olMarker = do (start, style', delim) <- anyOrderedListMarker
@@ -233,26 +249,13 @@ blockToMarkdown opts (CodeBlock (_,classes,_) str)
233249 writerLiterateHaskell opts =
234250 return $ prefixed "> " (text str) <> blankline
235251blockToMarkdown opts (CodeBlock attribs str) = return $
236− if writerStrictMarkdown opts || attribs == ([],[],[])
252+ if writerStrictMarkdown opts || attribs == nullAttr
237253 then nest (writerTabStop opts) (text str) <> blankline
238254 else -- use delimited code block
239255 flush (tildes <> space <> attrs <> cr <> text str <>
240256 cr <> tildes) <> blankline
241257 where tildes = text "~~~~"
242− attrs = braces $ hsep [attribId, attribClasses, attribKeys]
243− attribId = case attribs of
244− ([],_,_) -> empty
245− (i,_,_) -> "#" <> text i
246− attribClasses = case attribs of
247− (_,[],_) -> empty
248− (_,cs,_) -> hsep $
249− map (text . ('.':))
250− cs
251− attribKeys = case attribs of
252− (_,_,[]) -> empty
253− (_,_,ks) -> hsep $
254− map (\(k,v) -> text k
255− <> "=\"" <> text v <> "\"") ks
258+ attrs = attrsToMarkdown attribs
256259blockToMarkdown opts (BlockQuote blocks) = do
257260 st <- get
258261 -- if we're writing literate haskell, put a space before the bird tracks
@@ -423,14 +426,17 @@ inlineToMarkdown _ EmDash = return "\8212"
423426inlineToMarkdown _ EnDash = return "\8211"
424427inlineToMarkdown _ Apostrophe = return "\8217"
425428inlineToMarkdown _ Ellipses = return "\8230"
426−inlineToMarkdown _ (Code str) =
429+inlineToMarkdown opts (Code attr str) =
427430 let tickGroups = filter (\s -> '`' `elem` s) $ group str
428431 longest = if null tickGroups
429432 then 0
430433 else maximum $ map length tickGroups
431434 marker = replicate (longest + 1) '`'
432− spacer = if (longest == 0) then "" else " " in
433− return $ text (marker ++ spacer ++ str ++ spacer ++ marker)
435+ spacer = if (longest == 0) then "" else " "
436+ attrs = if writerStrictMarkdown opts || attr == nullAttr
437+ then empty
438+ else attrsToMarkdown attr
439+ in return $ text (marker ++ spacer ++ str ++ spacer ++ marker) <> attrs
434440inlineToMarkdown _ (Str str) = do
435441 st <- get
436442 if stPlain st
@@ -485,7 +491,9 @@ inlineToMarkdown opts (Link txt (src', tit)) = do
485491 let src = unescapeURI src'
486492 let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
487493 let useRefLinks = writerReferenceLinks opts
488− let useAuto = null tit && txt == [Code srcSuffix]
494+ let useAuto = case (tit,txt) of
495+ ("", [Code _ s]) | s == srcSuffix -> True
496+ _ -> False
489497 ref <- if useRefLinks then getReference txt (src, tit) else return []
490498 reftext <- inlineListToMarkdown opts ref
491499 return $ if useAuto
src/Text/Pandoc/Writers/MediaWiki.hs+7−7
@@ -362,7 +362,7 @@ inlineToMediaWiki _ Apostrophe = return "&rsquo;"
362362
363363inlineToMediaWiki _ Ellipses = return "&hellip;"
364364
365−inlineToMediaWiki _ (Code str) =
365+inlineToMediaWiki _ (Code _ str) =
366366 return $ "<tt>" ++ (escapeString str) ++ "</tt>"
367367
368368inlineToMediaWiki _ (Str str) = return $ escapeString str
@@ -380,12 +380,12 @@ inlineToMediaWiki _ Space = return " "
380380
381381inlineToMediaWiki opts (Link txt (src, _)) = do
382382 label <- inlineListToMediaWiki opts txt
383− if txt == [Code src] -- autolink
384− then return src
385− else if isURI src
386− then return $ "[" ++ src ++ " " ++ label ++ "]"
387− else return $ "[[" ++ src' ++ "|" ++ label ++ "]]"
388− where src' = case src of
383+ case txt of
384+ [Code _ s] | s == src -> return src
385+ _ -> if isURI src
386+ then return $ "[" ++ src ++ " " ++ label ++ "]"
387+ else return $ "[[" ++ src' ++ "|" ++ label ++ "]]"
388+ where src' = case src of
389389 '/':xs -> xs -- with leading / it's a
390390 _ -> src -- link to a help page
391391inlineToMediaWiki opts (Image alt (source, tit)) = do
src/Text/Pandoc/Writers/OpenDocument.hs+1−1
@@ -362,7 +362,7 @@ inlineToOpenDocument o ils
362362 | Subscript l <- ils = withTextStyle Sub $ inlinesToOpenDocument o l
363363 | SmallCaps l <- ils = withTextStyle SmallC $ inlinesToOpenDocument o l
364364 | Quoted t l <- ils = inQuotes t <$> inlinesToOpenDocument o l
365− | Code s <- ils = preformatted s
365+ | Code _ s <- ils = preformatted s
366366 | Math _ s <- ils = inlinesToOpenDocument o (readTeXMath s)
367367 | Cite _ l <- ils = inlinesToOpenDocument o l
368368 | RawInline "opendocument" s <- ils = preformatted s
src/Text/Pandoc/Writers/Org.hs+2−2
@@ -253,7 +253,7 @@ inlineToOrg EmDash = return "---"
253253inlineToOrg EnDash = return "--"
254254inlineToOrg Apostrophe = return "'"
255255inlineToOrg Ellipses = return "..."
256−inlineToOrg (Code str) = return $ "=" <> text str <> "="
256+inlineToOrg (Code _ str) = return $ "=" <> text str <> "="
257257inlineToOrg (Str str) = return $ text $ escapeString str
258258inlineToOrg (Math t str) = do
259259 modify $ \st -> st{ stHasMath = True }
@@ -266,7 +266,7 @@ inlineToOrg (LineBreak) = return cr -- there's no line break in Org
266266inlineToOrg Space = return space
267267inlineToOrg (Link txt (src, _)) = do
268268 case txt of
269− [Code x] | x == src -> -- autolink
269+ [Code _ x] | x == src -> -- autolink
270270 do modify $ \s -> s{ stLinks = True }
271271 return $ "[[" <> text x <> "]]"
272272 _ -> do contents <- inlineListToOrg txt
src/Text/Pandoc/Writers/RST.hs+3−3
@@ -285,7 +285,7 @@ inlineToRST EmDash = return $ char '\8212'
285285inlineToRST EnDash = return $ char '\8211'
286286inlineToRST Apostrophe = return $ char '\8217'
287287inlineToRST Ellipses = return $ char '\8230'
288−inlineToRST (Code str) = return $ "``" <> text str <> "``"
288+inlineToRST (Code _ str) = return $ "``" <> text str <> "``"
289289inlineToRST (Str str) = return $ text $ escapeString str
290290inlineToRST (Math t str) = do
291291 modify $ \st -> st{ stHasMath = True }
@@ -295,8 +295,8 @@ inlineToRST (Math t str) = do
295295inlineToRST (RawInline _ _) = return empty
296296inlineToRST (LineBreak) = return cr -- there's no line break in RST
297297inlineToRST Space = return space
298−inlineToRST (Link [Code str] (src, _)) | src == str ||
299− src == "mailto:" ++ str = do
298+inlineToRST (Link [Code _ str] (src, _)) | src == str ||
299+ src == "mailto:" ++ str = do
300300 let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
301301 return $ text $ unescapeURI srcSuffix
302302inlineToRST (Link txt (src', tit)) = do
src/Text/Pandoc/Writers/RTF.hs+1−1
@@ -265,7 +265,7 @@ inlineToRTF Apostrophe = "\\u8217'"
265265inlineToRTF Ellipses = "\\u8230?"
266266inlineToRTF EmDash = "\\u8212-"
267267inlineToRTF EnDash = "\\u8211-"
268−inlineToRTF (Code str) = "{\\f1 " ++ (codeStringToRTF str) ++ "}"
268+inlineToRTF (Code _ str) = "{\\f1 " ++ (codeStringToRTF str) ++ "}"
269269inlineToRTF (Str str) = stringToRTF str
270270inlineToRTF (Math _ str) = inlineListToRTF $ readTeXMath str
271271inlineToRTF (Cite _ lst) = inlineListToRTF lst
src/Text/Pandoc/Writers/Texinfo.hs+2−2
@@ -372,7 +372,7 @@ inlineToTexinfo (Subscript lst) = do
372372inlineToTexinfo (SmallCaps lst) =
373373 inlineListToTexinfo lst >>= return . inCmd "sc"
374374
375−inlineToTexinfo (Code str) = do
375+inlineToTexinfo (Code _ str) = do
376376 return $ text $ "@code{" ++ stringToTexinfo str ++ "}"
377377
378378inlineToTexinfo (Quoted SingleQuote lst) = do
@@ -400,7 +400,7 @@ inlineToTexinfo Space = return $ char ' '
400400
401401inlineToTexinfo (Link txt (src, _)) = do
402402 case txt of
403− [Code x] | x == src -> -- autolink
403+ [Code _ x] | x == src -> -- autolink
404404 do return $ text $ "@url{" ++ x ++ "}"
405405 _ -> do contents <- inlineListToTexinfo txt
406406 let src1 = stringToTexinfo src
src/Text/Pandoc/Writers/Textile.hs+3−3
@@ -378,7 +378,7 @@ inlineToTextile _ Apostrophe = return "'"
378378
379379inlineToTextile _ Ellipses = return "..."
380380
381−inlineToTextile _ (Code str) =
381+inlineToTextile _ (Code _ str) =
382382 return $ if '@' `elem` str
383383 then "<tt>" ++ escapeStringForXML str ++ "</tt>"
384384 else "@" ++ str ++ "@"
@@ -399,8 +399,8 @@ inlineToTextile _ Space = return " "
399399
400400inlineToTextile opts (Link txt (src, _)) = do
401401 label <- case txt of
402− [Code s] -> return s
403− _ -> inlineListToTextile opts txt
402+ [Code _ s] -> return s
403+ _ -> inlineListToTextile opts txt
404404 return $ "\"" ++ label ++ "\":" ++ src
405405
406406inlineToTextile opts (Image alt (source, tit)) = do
tests/Tests/Arbitrary.hs+1−1
@@ -30,7 +30,7 @@ instance Arbitrary Inline where
3030arbInline :: Int -> Gen Inline
3131arbInline n = frequency $ [ (60, liftM Str realString)
3232 , (60, return Space)
33− , (10, liftM Code realString)
33+ , (10, liftM2 Code arbitrary realString)
3434 , (5, return EmDash)
3535 , (5, return EnDash)
3636 , (5, return Apostrophe)
tests/html-reader.native+5−5
@@ -224,14 +224,14 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
224224,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Str "."]
225225,Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em",Str "."]]]
226226,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Str "."]
227−,Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ">",Str ",",Space,Code "$",Str ",",Space,Code "\\",Str ",",Space,Code "\\$",Str ",",Space,Code "<html>",Str "."]
227+,Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ("",[],[]) ">",Str ",",Space,Code ("",[],[]) "$",Str ",",Space,Code ("",[],[]) "\\",Str ",",Space,Code ("",[],[]) "\\$",Str ",",Space,Code ("",[],[]) "<html>",Str "."]
228228,HorizontalRule
229229,Header 1 [Str "Smart",Space,Str "quotes,",Space,Str "ellipses,",Space,Str "dashes"]
230230,Para [Str "\"",Str "Hello,",Str "\"",Space,Str "said",Space,Str "the",Space,Str "spider",Str ".",Space,Str "\"",Str "'",Str "Shelob",Str "'",Space,Str "is",Space,Str "my",Space,Str "name",Str ".",Str "\""]
231231,Para [Str "'",Str "A",Str "'",Str ",",Space,Str "'",Str "B",Str "'",Str ",",Space,Str "and",Space,Str "'",Str "C",Str "'",Space,Str "are",Space,Str "letters",Str "."]
232232,Para [Str "'",Str "Oak,",Str "'",Space,Str "'",Str "elm,",Str "'",Space,Str "and",Space,Str "'",Str "beech",Str "'",Space,Str "are",Space,Str "names",Space,Str "of",Space,Str "trees",Str ".",Space,Str "So",Space,Str "is",Space,Str "'",Str "pine",Str ".",Str "'"]
233233,Para [Str "'",Str "He",Space,Str "said,",Space,Str "\"",Str "I",Space,Str "want",Space,Str "to",Space,Str "go",Str ".",Str "\"",Str "'",Space,Str "Were",Space,Str "you",Space,Str "alive",Space,Str "in",Space,Str "the",Space,Str "70",Str "'",Str "s?"]
234−,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Str "'",Code "code",Str "'",Space,Str "and",Space,Str "a",Space,Str "\"",Link [Str "quoted",Space,Str "link"] ("http://example.com/?foo=1&bar=2",""),Str "\"",Str "."]
234+,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Str "'",Code ("",[],[]) "code",Str "'",Space,Str "and",Space,Str "a",Space,Str "\"",Link [Str "quoted",Space,Str "link"] ("http://example.com/?foo=1&bar=2",""),Str "\"",Str "."]
235235,Para [Str "Some",Space,Str "dashes:",Space,Str "one",Str "-",Str "-",Str "-",Str "two",Space,Str "-",Str "-",Str "-",Space,Str "three",Str "-",Str "-",Str "four",Space,Str "-",Str "-",Space,Str "five",Str "."]
236236,Para [Str "Dashes",Space,Str "between",Space,Str "numbers:",Space,Str "5",Str "-",Str "7,",Space,Str "255",Str "-",Str "66,",Space,Str "1987",Str "-",Str "1999",Str "."]
237237,Para [Str "Ellipses",Str ".",Str ".",Str ".",Str "and",Str ".",Space,Str ".",Space,Str ".",Str "and",Space,Str ".",Space,Str ".",Space,Str ".",Space,Str "."]
@@ -249,9 +249,9 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
249249 ,[Plain [Str "Here",Str "'",Str "s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,Str "$\\alpha",Space,Str "+",Space,Str "\\omega",Space,Str "\\times",Space,Str "x^2$",Str "."]]]
250250,Para [Str "These",Space,Str "shouldn",Str "'",Str "t",Space,Str "be",Space,Str "math:"]
251251,BulletList
252− [[Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code "$e = mc^2$",Str "."]]
252+ [[Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code ("",[],[]) "$e = mc^2$",Str "."]]
253253 ,[Plain [Str "$22,000",Space,Str "is",Space,Str "a",Space,Emph [Str "lot"],Space,Str "of",Space,Str "money",Str ".",Space,Str "So",Space,Str "is",Space,Str "$34,000",Str ".",Space,Str "(It",Space,Str "worked",Space,Str "if",Space,Str "\"",Str "lot",Str "\"",Space,Str "is",Space,Str "emphasized",Str ".",Str ")"]]
254− ,[Plain [Str "Escaped",Space,Code "$",Str ":",Space,Str "$73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23$",Str "."]]]
254+ ,[Plain [Str "Escaped",Space,Code ("",[],[]) "$",Str ":",Space,Str "$73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23$",Str "."]]]
255255,Para [Str "Here",Str "'",Str "s",Space,Str "a",Space,Str "LaTeX",Space,Str "table:"]
256256,Para [Str "\\begin{tabular}{|l|l|}\\hline",Space,Str "Animal",Space,Str "&",Space,Str "Number",Space,Str "\\\\",Space,Str "\\hline",Space,Str "Dog",Space,Str "&",Space,Str "2",Space,Str "\\\\",Space,Str "Cat",Space,Str "&",Space,Str "1",Space,Str "\\\\",Space,Str "\\hline",Space,Str "\\end{tabular}"]
257257,HorizontalRule
@@ -322,7 +322,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
322322,Plain [Str "An",Space,Str "e",Str "-",Str "mail",Space,Str "address:",Space,Str "nobody",Space,Str "[at]",Space,Str "nowhere",Str ".",Str "net"]
323323,BlockQuote
324324 [Para [Str "Blockquoted:",Space,Link [Str "http://example",Str ".",Str "com/"] ("http://example.com/","")]]
325−,Para [Str "Auto",Str "-",Str "links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code "<http://example.com/>"]
325+,Para [Str "Auto",Str "-",Str "links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) "<http://example.com/>"]
326326,CodeBlock ("",[],[]) "or here: <http://example.com/>"
327327,HorizontalRule
328328,Header 1 [Str "Images"]
tests/latex-reader.native+10−10
@@ -240,7 +240,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
240240,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."]
241241,Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]]
242242,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."]
243−,Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ">",Str ",",Space,Code "$",Str ",",Space,Code "\\",Str ",",Space,Code "\\$",Str ",",Space,Code "<html>",Str "."]
243+,Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ("",[],[]) ">",Str ",",Space,Code ("",[],[]) "$",Str ",",Space,Code ("",[],[]) "\\",Str ",",Space,Code ("",[],[]) "\\$",Str ",",Space,Code ("",[],[]) "<html>",Str "."]
244244,Para [Strikeout [Str "This",Space,Str "is",Space,Emph [Str "strikeout"],Str "."]]
245245,Para [Str "Superscripts:",Space,Str "a",Superscript [Str "bc"],Str "d",Space,Str "a",Superscript [Emph [Str "hello"]],Space,Str "a",Superscript [Str "hello",Space,Str "there"],Str "."]
246246,Para [Str "Subscripts:",Space,Str "H",Subscript [Str "2"],Str "O,",Space,Str "H",Subscript [Str "23"],Str "O,",Space,Str "H",Subscript [Str "many",Space,Str "of",Space,Str "them"],Str "O."]
@@ -251,7 +251,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
251251,Para [Quoted SingleQuote [Str "A"],Str ",",Space,Quoted SingleQuote [Str "B"],Str ",",Space,Str "and",Space,Quoted SingleQuote [Str "C"],Space,Str "are",Space,Str "letters."]
252252,Para [Quoted SingleQuote [Str "Oak,"],Space,Quoted SingleQuote [Str "elm,"],Space,Str "and",Space,Quoted SingleQuote [Str "beech"],Space,Str "are",Space,Str "names",Space,Str "of",Space,Str "trees.",Space,Str "So",Space,Str "is",Space,Quoted SingleQuote [Str "pine."]]
253253,Para [Quoted SingleQuote [Str "He",Space,Str "said,",Space,Quoted DoubleQuote [Str "I",Space,Str "want",Space,Str "to",Space,Str "go."]],Space,Str "Were",Space,Str "you",Space,Str "alive",Space,Str "in",Space,Str "the",Space,Str "70",Apostrophe,Str "s?"]
254−,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Quoted SingleQuote [Code "code"],Space,Str "and",Space,Str "a",Space,Quoted DoubleQuote [Link [Str "quoted",Space,Str "link"] ("http://example.com/?foo=1&bar=2","")],Str "."]
254+,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Quoted SingleQuote [Code ("",[],[]) "code"],Space,Str "and",Space,Str "a",Space,Quoted DoubleQuote [Link [Str "quoted",Space,Str "link"] ("http://example.com/?foo=1&bar=2","")],Str "."]
255255,Para [Str "Some",Space,Str "dashes:",Space,Str "one",EmDash,Str "two",EmDash,Str "three",EmDash,Str "four",EmDash,Str "five."]
256256,Para [Str "Dashes",Space,Str "between",Space,Str "numbers:",Space,Str "5",EnDash,Str "7,",Space,Str "255",EnDash,Str "66,",Space,Str "1987",EnDash,Str "1999."]
257257,Para [Str "Ellipses",Ellipses,Str "and",Ellipses,Str "and",Ellipses,Str "."]
@@ -269,9 +269,9 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
269269 ,[Para [Str "Here",Apostrophe,Str "s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,Math InlineMath "\\alpha + \\omega \\times x^2",Str "."]]]
270270,Para [Str "These",Space,Str "shouldn",Apostrophe,Str "t",Space,Str "be",Space,Str "math:"]
271271,BulletList
272− [[Para [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code "$e = mc^2$",Str "."]]
272+ [[Para [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code ("",[],[]) "$e = mc^2$",Str "."]]
273273 ,[Para [Str "$",Str "22,000",Space,Str "is",Space,Str "a",Space,Emph [Str "lot"],Space,Str "of",Space,Str "money.",Space,Str "So",Space,Str "is",Space,Str "$",Str "34,000.",Space,Str "(It",Space,Str "worked",Space,Str "if",Space,Quoted DoubleQuote [Str "lot"],Space,Str "is",Space,Str "emphasized.)"]]
274− ,[Para [Str "Escaped",Space,Code "$",Str ":",Space,Str "$",Str "73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23",Str "$",Str "."]]]
274+ ,[Para [Str "Escaped",Space,Code ("",[],[]) "$",Str ":",Space,Str "$",Str "73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23",Str "$",Str "."]]]
275275,Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "LaTeX",Space,Str "table:"]
276276,Table [] [AlignLeft,AlignLeft] [0.0,0.0]
277277 [[Plain [Str "Animal"]]
@@ -341,15 +341,15 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
341341,Para [Str "Here",Apostrophe,Str "s",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."]
342342,Para [Str "Here",Apostrophe,Str "s",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."]
343343,Header 2 [Str "Autolinks"]
344−,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link [Code "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")]
344+,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link [Code ("",["url"],[]) "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")]
345345,BulletList
346346 [[Para [Str "In",Space,Str "a",Space,Str "list?"]]
347− ,[Para [Link [Code "http://example.com/"] ("http://example.com/","")]]
347+ ,[Para [Link [Code ("",["url"],[]) "http://example.com/"] ("http://example.com/","")]]
348348 ,[Para [Str "It",Space,Str "should."]]]
349−,Para [Str "An",Space,Str "e",Str "-",Str "mail",Space,Str "address:",Space,Link [Code "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")]
349+,Para [Str "An",Space,Str "e",Str "-",Str "mail",Space,Str "address:",Space,Link [Code ("",[],[]) "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")]
350350,BlockQuote
351− [Para [Str "Blockquoted:",Space,Link [Code "http://example.com/"] ("http://example.com/","")]]
352−,Para [Str "Auto",Str "-",Str "links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code "<http://example.com/>"]
351+ [Para [Str "Blockquoted:",Space,Link [Code ("",["url"],[]) "http://example.com/"] ("http://example.com/","")]]
352+,Para [Str "Auto",Str "-",Str "links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) "<http://example.com/>"]
353353,CodeBlock ("",[],[]) "or here: <http://example.com/>"
354354,HorizontalRule
355355,Header 1 [Str "Images"]
@@ -358,7 +358,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
358358,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "movie",Space,Image [Str "image"] ("movie.jpg",""),Space,Str "icon."]
359359,HorizontalRule
360360,Header 1 [Str "Footnotes"]
361−,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "footnote",Space,Str "reference,",Note [Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "footnote.",Space,Str "It",Space,Str "can",Space,Str "go",Space,Str "anywhere",Space,Str "after",Space,Str "the",Space,Str "footnote",Space,Str "reference.",Space,Str "It",Space,Str "need",Space,Str "not",Space,Str "be",Space,Str "placed",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "document."]],Space,Str "and",Space,Str "another.",Note [Para [Str "Here",Apostrophe,Str "s",Space,Str "the",Space,Str "long",Space,Str "note.",Space,Str "This",Space,Str "one",Space,Str "contains",Space,Str "multiple",Space,Str "blocks."],Para [Str "Subsequent",Space,Str "blocks",Space,Str "are",Space,Str "indented",Space,Str "to",Space,Str "show",Space,Str "that",Space,Str "they",Space,Str "belong",Space,Str "to",Space,Str "the",Space,Str "footnote",Space,Str "(as",Space,Str "with",Space,Str "list",Space,Str "items)."],CodeBlock ("",[],[]) " { <code> }",Para [Str "If",Space,Str "you",Space,Str "want,",Space,Str "you",Space,Str "can",Space,Str "indent",Space,Str "every",Space,Str "line,",Space,Str "but",Space,Str "you",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "lazy",Space,Str "and",Space,Str "just",Space,Str "indent",Space,Str "the",Space,Str "first",Space,Str "line",Space,Str "of",Space,Str "each",Space,Str "block."]],Space,Str "This",Space,Str "should",Space,Emph [Str "not"],Space,Str "be",Space,Str "a",Space,Str "footnote",Space,Str "reference,",Space,Str "because",Space,Str "it",Space,Str "contains",Space,Str "a",Space,Str "space.",Str "[",Str "^",Str "my",Space,Str "note",Str "]",Space,Str "Here",Space,Str "is",Space,Str "an",Space,Str "inline",Space,Str "note.",Note [Para [Str "This",Space,Str "is",Space,Emph [Str "easier"],Space,Str "to",Space,Str "type.",Space,Str "Inline",Space,Str "notes",Space,Str "may",Space,Str "contain",Space,Link [Str "links"] ("http://google.com",""),Space,Str "and",Space,Code "]",Space,Str "verbatim",Space,Str "characters,",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str "[",Str "bracketed",Space,Str "text",Str "]",Str "."]]]
361+,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "footnote",Space,Str "reference,",Note [Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "footnote.",Space,Str "It",Space,Str "can",Space,Str "go",Space,Str "anywhere",Space,Str "after",Space,Str "the",Space,Str "footnote",Space,Str "reference.",Space,Str "It",Space,Str "need",Space,Str "not",Space,Str "be",Space,Str "placed",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "document."]],Space,Str "and",Space,Str "another.",Note [Para [Str "Here",Apostrophe,Str "s",Space,Str "the",Space,Str "long",Space,Str "note.",Space,Str "This",Space,Str "one",Space,Str "contains",Space,Str "multiple",Space,Str "blocks."],Para [Str "Subsequent",Space,Str "blocks",Space,Str "are",Space,Str "indented",Space,Str "to",Space,Str "show",Space,Str "that",Space,Str "they",Space,Str "belong",Space,Str "to",Space,Str "the",Space,Str "footnote",Space,Str "(as",Space,Str "with",Space,Str "list",Space,Str "items)."],CodeBlock ("",[],[]) " { <code> }",Para [Str "If",Space,Str "you",Space,Str "want,",Space,Str "you",Space,Str "can",Space,Str "indent",Space,Str "every",Space,Str "line,",Space,Str "but",Space,Str "you",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "lazy",Space,Str "and",Space,Str "just",Space,Str "indent",Space,Str "the",Space,Str "first",Space,Str "line",Space,Str "of",Space,Str "each",Space,Str "block."]],Space,Str "This",Space,Str "should",Space,Emph [Str "not"],Space,Str "be",Space,Str "a",Space,Str "footnote",Space,Str "reference,",Space,Str "because",Space,Str "it",Space,Str "contains",Space,Str "a",Space,Str "space.",Str "[",Str "^",Str "my",Space,Str "note",Str "]",Space,Str "Here",Space,Str "is",Space,Str "an",Space,Str "inline",Space,Str "note.",Note [Para [Str "This",Space,Str "is",Space,Emph [Str "easier"],Space,Str "to",Space,Str "type.",Space,Str "Inline",Space,Str "notes",Space,Str "may",Space,Str "contain",Space,Link [Str "links"] ("http://google.com",""),Space,Str "and",Space,Code ("",[],[]) "]",Space,Str "verbatim",Space,Str "characters,",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str "[",Str "bracketed",Space,Str "text",Str "]",Str "."]]]
362362,BlockQuote
363363 [Para [Str "Notes",Space,Str "can",Space,Str "go",Space,Str "in",Space,Str "quotes.",Note [Para [Str "In",Space,Str "quote."]]]]
364364,OrderedList (1,Decimal,Period)
tests/lhs-test.fragment.html+lhs+1−2
@@ -30,8 +30,7 @@
3030 > <br
3131 />&gt; <span class="co"
3232 >-- arr (\op (x,y) -&gt; x `op` y) </span
33− ><br
34− /></code
33+ ></code
3534 ></pre
3635><p
3736><code
tests/lhs-test.html+1−2
@@ -57,8 +57,7 @@ pre.sourceCode span.er { color: red; font-weight: bold; }
5757 > <br
5858 /> <span class="co"
5959 >-- arr (\op (x,y) -&gt; x `op` y) </span
60− ><br
61− /></code
60+ ></code
6261 ></pre
6362><p
6463><code
tests/lhs-test.html+lhs+1−2
@@ -57,8 +57,7 @@ pre.sourceCode span.er { color: red; font-weight: bold; }
5757 > <br
5858 />&gt; <span class="co"
5959 >-- arr (\op (x,y) -&gt; x `op` y) </span
60− ><br
61− /></code
60+ ></code
6261 ></pre
6362><p
6463><code
tests/lhs-test.native+2−2
@@ -1,7 +1,7 @@
11[Header 1 [Str "lhs",Space,Str "test"]
2−,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",Str ":"]
2+,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",Str ":"]
33,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) "
4−,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)",Str "."]
4+,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)",Str "."]
55,CodeBlock ("",[],[]) "f *** g = first f >>> second g"
66,Para [Str "Block",Space,Str "quote",Str ":"]
77,BlockQuote
tests/markdown-reader-more.native+5−5
@@ -23,15 +23,15 @@
2323,Header 2 [Str "Backslash",Space,Str "newline"]
2424,Para [Str "hi",LineBreak,Str "there"]
2525,Header 2 [Str "Code",Space,Str "spans"]
26−,Para [Code "hi\\"]
27−,Para [Code "hi there"]
28−,Para [Code "hi````there"]
26+,Para [Code ("",[],[]) "hi\\"]
27+,Para [Code ("",[],[]) "hi there"]
28+,Para [Code ("",[],[]) "hi````there"]
2929,Para [Str "`",Str "hi"]
3030,Para [Str "there",Str "`"]
3131,Header 2 [Str "Multilingual",Space,Str "URLs"]
32−,Para [Link [Code "http://\27979.com?\27979=\27979"] ("http://%E6%B5%8B.com?%E6%B5%8B=%E6%B5%8B","")]
32+,Para [Link [Code ("",["url"],[]) "http://\27979.com?\27979=\27979"] ("http://%E6%B5%8B.com?%E6%B5%8B=%E6%B5%8B","")]
3333,Para [Link [Str "foo"] ("/bar/%E6%B5%8B?x=%E6%B5%8B","title")]
34−,Para [Link [Code "\27979@foo.\27979.baz"] ("mailto:%E6%B5%8B@foo.%E6%B5%8B.baz","")]
34+,Para [Link [Code ("",["url"],[]) "\27979@foo.\27979.baz"] ("mailto:%E6%B5%8B@foo.%E6%B5%8B.baz","")]
3535,Header 2 [Str "Numbered",Space,Str "examples"]
3636,OrderedList (1,Example,TwoParens)
3737 [[Plain [Str "First",Space,Str "example",Str "."]]
tests/rst-reader.native+1−1
@@ -182,7 +182,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite",Str ":
182182,RawBlock "latex" "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}\n"
183183,Header 1 [Str "Inline",Space,Str "Markup"]
184184,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ".",Space,Str "This",Space,Str "is",Space,Strong [Str "strong"],Str "."]
185−,Para [Str "This",Space,Str "is",Space,Str "code",Str ":",Space,Code ">",Str ",",Space,Code "$",Str ",",Space,Code "\\",Str ",",Space,Code "\\$",Str ",",Space,Code "<html>",Str "."]
185+,Para [Str "This",Space,Str "is",Space,Str "code",Str ":",Space,Code ("",[],[]) ">",Str ",",Space,Code ("",[],[]) "$",Str ",",Space,Code ("",[],[]) "\\",Str ",",Space,Code ("",[],[]) "\\$",Str ",",Space,Code ("",[],[]) "<html>",Str "."]
186186,Para [Str "This",Space,Str "is",Subscript [Str "subscripted"],Space,Str "and",Space,Str "this",Space,Str "is",Space,Superscript [Str "superscripted"],Str "."]
187187,Header 1 [Str "Special",Space,Str "Characters"]
188188,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "unicode",Str ":"]
tests/testsuite.native+10−10
@@ -276,7 +276,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
276276,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Str "."]
277277,Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em",Str "."]]]
278278,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Str "."]
279−,Para [Str "This",Space,Str "is",Space,Str "code",Str ":",Space,Code ">",Str ",",Space,Code "$",Str ",",Space,Code "\\",Str ",",Space,Code "\\$",Str ",",Space,Code "<html>",Str "."]
279+,Para [Str "This",Space,Str "is",Space,Str "code",Str ":",Space,Code ("",[],[]) ">",Str ",",Space,Code ("",[],[]) "$",Str ",",Space,Code ("",[],[]) "\\",Str ",",Space,Code ("",[],[]) "\\$",Str ",",Space,Code ("",[],[]) "<html>",Str "."]
280280,Para [Strikeout [Str "This",Space,Str "is",Space,Emph [Str "strikeout"],Str "."]]
281281,Para [Str "Superscripts",Str ":",Space,Str "a",Superscript [Str "bc"],Str "d",Space,Str "a",Superscript [Emph [Str "hello"]],Space,Str "a",Superscript [Str "hello",Str "\160",Str "there"],Str "."]
282282,Para [Str "Subscripts",Str ":",Space,Str "H",Subscript [Str "2"],Str "O",Str ",",Space,Str "H",Subscript [Str "23"],Str "O",Str ",",Space,Str "H",Subscript [Str "many",Str "\160",Str "of",Str "\160",Str "them"],Str "O",Str "."]
@@ -287,7 +287,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
287287,Para [Quoted SingleQuote [Str "A"],Str ",",Space,Quoted SingleQuote [Str "B"],Str ",",Space,Str "and",Space,Quoted SingleQuote [Str "C"],Space,Str "are",Space,Str "letters",Str "."]
288288,Para [Quoted SingleQuote [Str "Oak",Str ","],Space,Quoted SingleQuote [Str "elm",Str ","],Space,Str "and",Space,Quoted SingleQuote [Str "beech"],Space,Str "are",Space,Str "names",Space,Str "of",Space,Str "trees",Str ".",Space,Str "So",Space,Str "is",Space,Quoted SingleQuote [Str "pine",Str "."]]
289289,Para [Quoted SingleQuote [Str "He",Space,Str "said",Str ",",Space,Quoted DoubleQuote [Str "I",Space,Str "want",Space,Str "to",Space,Str "go",Str "."]],Space,Str "Were",Space,Str "you",Space,Str "alive",Space,Str "in",Space,Str "the",Space,Str "70",Apostrophe,Str "s",Str "?"]
290−,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Quoted SingleQuote [Code "code"],Space,Str "and",Space,Str "a",Space,Quoted DoubleQuote [Link [Str "quoted",Space,Str "link"] ("http://example.com/?foo=1&bar=2","")],Str "."]
290+,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Quoted SingleQuote [Code ("",[],[]) "code"],Space,Str "and",Space,Str "a",Space,Quoted DoubleQuote [Link [Str "quoted",Space,Str "link"] ("http://example.com/?foo=1&bar=2","")],Str "."]
291291,Para [Str "Some",Space,Str "dashes",Str ":",Space,Str "one",EmDash,Str "two",Space,EmDash,Space,Str "three",EmDash,Str "four",Space,EmDash,Space,Str "five",Str "."]
292292,Para [Str "Dashes",Space,Str "between",Space,Str "numbers",Str ":",Space,Str "5",EnDash,Str "7",Str ",",Space,Str "255",EnDash,Str "66",Str ",",Space,Str "1987",EnDash,Str "1999",Str "."]
293293,Para [Str "Ellipses",Ellipses,Str "and",Ellipses,Str "and",Ellipses,Str "."]
@@ -304,10 +304,10 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
304304 ,[Plain [Str "Here",Apostrophe,Str "s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it",Str ":",Space,Math InlineMath "\\alpha + \\omega \\times x^2",Str "."]]]
305305,Para [Str "These",Space,Str "shouldn",Apostrophe,Str "t",Space,Str "be",Space,Str "math",Str ":"]
306306,BulletList
307− [[Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation",Str ",",Space,Str "write",Space,Code "$e = mc^2$",Str "."]]
307+ [[Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation",Str ",",Space,Str "write",Space,Code ("",[],[]) "$e = mc^2$",Str "."]]
308308 ,[Plain [Str "$",Str "22",Str ",",Str "000",Space,Str "is",Space,Str "a",Space,Emph [Str "lot"],Space,Str "of",Space,Str "money",Str ".",Space,Str "So",Space,Str "is",Space,Str "$",Str "34",Str ",",Str "000",Str ".",Space,Str "(",Str "It",Space,Str "worked",Space,Str "if",Space,Quoted DoubleQuote [Str "lot"],Space,Str "is",Space,Str "emphasized",Str ".",Str ")"]]
309309 ,[Plain [Str "Shoes",Space,Str "(",Str "$",Str "20",Str ")",Space,Str "and",Space,Str "socks",Space,Str "(",Str "$",Str "5",Str ")",Str "."]]
310− ,[Plain [Str "Escaped",Space,Code "$",Str ":",Space,Str "$",Str "73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23",Str "$",Str "."]]]
310+ ,[Plain [Str "Escaped",Space,Code ("",[],[]) "$",Str ":",Space,Str "$",Str "73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23",Str "$",Str "."]]]
311311,Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "LaTeX",Space,Str "table",Str ":"]
312312,RawBlock "latex" "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
313313,HorizontalRule
@@ -371,15 +371,15 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
371371,Para [Str "Here",Apostrophe,Str "s",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."]
372372,Para [Str "Here",Apostrophe,Str "s",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."]
373373,Header 2 [Str "Autolinks"]
374−,Para [Str "With",Space,Str "an",Space,Str "ampersand",Str ":",Space,Link [Code "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")]
374+,Para [Str "With",Space,Str "an",Space,Str "ampersand",Str ":",Space,Link [Code ("",["url"],[]) "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")]
375375,BulletList
376376 [[Plain [Str "In",Space,Str "a",Space,Str "list",Str "?"]]
377− ,[Plain [Link [Code "http://example.com/"] ("http://example.com/","")]]
377+ ,[Plain [Link [Code ("",["url"],[]) "http://example.com/"] ("http://example.com/","")]]
378378 ,[Plain [Str "It",Space,Str "should",Str "."]]]
379−,Para [Str "An",Space,Str "e",Str "-",Str "mail",Space,Str "address",Str ":",Space,Link [Code "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")]
379+,Para [Str "An",Space,Str "e",Str "-",Str "mail",Space,Str "address",Str ":",Space,Link [Code ("",["url"],[]) "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")]
380380,BlockQuote
381− [Para [Str "Blockquoted",Str ":",Space,Link [Code "http://example.com/"] ("http://example.com/","")]]
382−,Para [Str "Auto",Str "-",Str "links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here",Str ":",Space,Code "<http://example.com/>"]
381+ [Para [Str "Blockquoted",Str ":",Space,Link [Code ("",["url"],[]) "http://example.com/"] ("http://example.com/","")]]
382+,Para [Str "Auto",Str "-",Str "links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here",Str ":",Space,Code ("",[],[]) "<http://example.com/>"]
383383,CodeBlock ("",[],[]) "or here: <http://example.com/>"
384384,HorizontalRule
385385,Header 1 [Str "Images"]
@@ -388,7 +388,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
388388,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "movie",Space,Image [Str "movie"] ("movie.jpg",""),Space,Str "icon",Str "."]
389389,HorizontalRule
390390,Header 1 [Str "Footnotes"]
391−,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "footnote",Space,Str "reference",Str ",",Note [Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "footnote",Str ".",Space,Str "It",Space,Str "can",Space,Str "go",Space,Str "anywhere",Space,Str "after",Space,Str "the",Space,Str "footnote",Space,Str "reference",Str ".",Space,Str "It",Space,Str "need",Space,Str "not",Space,Str "be",Space,Str "placed",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "document",Str "."]],Space,Str "and",Space,Str "another",Str ".",Note [Para [Str "Here",Apostrophe,Str "s",Space,Str "the",Space,Str "long",Space,Str "note",Str ".",Space,Str "This",Space,Str "one",Space,Str "contains",Space,Str "multiple",Space,Str "blocks",Str "."],Para [Str "Subsequent",Space,Str "blocks",Space,Str "are",Space,Str "indented",Space,Str "to",Space,Str "show",Space,Str "that",Space,Str "they",Space,Str "belong",Space,Str "to",Space,Str "the",Space,Str "footnote",Space,Str "(",Str "as",Space,Str "with",Space,Str "list",Space,Str "items",Str ")",Str "."],CodeBlock ("",[],[]) " { <code> }",Para [Str "If",Space,Str "you",Space,Str "want",Str ",",Space,Str "you",Space,Str "can",Space,Str "indent",Space,Str "every",Space,Str "line",Str ",",Space,Str "but",Space,Str "you",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "lazy",Space,Str "and",Space,Str "just",Space,Str "indent",Space,Str "the",Space,Str "first",Space,Str "line",Space,Str "of",Space,Str "each",Space,Str "block",Str "."]],Space,Str "This",Space,Str "should",Space,Emph [Str "not"],Space,Str "be",Space,Str "a",Space,Str "footnote",Space,Str "reference",Str ",",Space,Str "because",Space,Str "it",Space,Str "contains",Space,Str "a",Space,Str "space",Str ".",Str "[",Str "^",Str "my",Space,Str "note",Str "]",Space,Str "Here",Space,Str "is",Space,Str "an",Space,Str "inline",Space,Str "note",Str ".",Note [Para [Str "This",Space,Str "is",Space,Emph [Str "easier"],Space,Str "to",Space,Str "type",Str ".",Space,Str "Inline",Space,Str "notes",Space,Str "may",Space,Str "contain",Space,Link [Str "links"] ("http://google.com",""),Space,Str "and",Space,Code "]",Space,Str "verbatim",Space,Str "characters",Str ",",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str "[",Str "bracketed",Space,Str "text",Str "]",Str "."]]]
391+,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "footnote",Space,Str "reference",Str ",",Note [Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "footnote",Str ".",Space,Str "It",Space,Str "can",Space,Str "go",Space,Str "anywhere",Space,Str "after",Space,Str "the",Space,Str "footnote",Space,Str "reference",Str ".",Space,Str "It",Space,Str "need",Space,Str "not",Space,Str "be",Space,Str "placed",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "document",Str "."]],Space,Str "and",Space,Str "another",Str ".",Note [Para [Str "Here",Apostrophe,Str "s",Space,Str "the",Space,Str "long",Space,Str "note",Str ".",Space,Str "This",Space,Str "one",Space,Str "contains",Space,Str "multiple",Space,Str "blocks",Str "."],Para [Str "Subsequent",Space,Str "blocks",Space,Str "are",Space,Str "indented",Space,Str "to",Space,Str "show",Space,Str "that",Space,Str "they",Space,Str "belong",Space,Str "to",Space,Str "the",Space,Str "footnote",Space,Str "(",Str "as",Space,Str "with",Space,Str "list",Space,Str "items",Str ")",Str "."],CodeBlock ("",[],[]) " { <code> }",Para [Str "If",Space,Str "you",Space,Str "want",Str ",",Space,Str "you",Space,Str "can",Space,Str "indent",Space,Str "every",Space,Str "line",Str ",",Space,Str "but",Space,Str "you",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "lazy",Space,Str "and",Space,Str "just",Space,Str "indent",Space,Str "the",Space,Str "first",Space,Str "line",Space,Str "of",Space,Str "each",Space,Str "block",Str "."]],Space,Str "This",Space,Str "should",Space,Emph [Str "not"],Space,Str "be",Space,Str "a",Space,Str "footnote",Space,Str "reference",Str ",",Space,Str "because",Space,Str "it",Space,Str "contains",Space,Str "a",Space,Str "space",Str ".",Str "[",Str "^",Str "my",Space,Str "note",Str "]",Space,Str "Here",Space,Str "is",Space,Str "an",Space,Str "inline",Space,Str "note",Str ".",Note [Para [Str "This",Space,Str "is",Space,Emph [Str "easier"],Space,Str "to",Space,Str "type",Str ".",Space,Str "Inline",Space,Str "notes",Space,Str "may",Space,Str "contain",Space,Link [Str "links"] ("http://google.com",""),Space,Str "and",Space,Code ("",[],[]) "]",Space,Str "verbatim",Space,Str "characters",Str ",",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str "[",Str "bracketed",Space,Str "text",Str "]",Str "."]]]
392392,BlockQuote
393393 [Para [Str "Notes",Space,Str "can",Space,Str "go",Space,Str "in",Space,Str "quotes",Str ".",Note [Para [Str "In",Space,Str "quote",Str "."]]]]
394394,OrderedList (1,Decimal,Period)
tests/textile-reader.native+1−1
@@ -26,7 +26,7 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
2626,Para [Str "And",Str ":"]
2727,CodeBlock ("",[],[]) " this code block is indented by two tabs\n\n These should not be escaped: \\$ \\\\ \\> \\[ \\{"
2828,CodeBlock ("",[],[]) "Code block with .bc\n continued\n @</\\\n"
29−,Para [Str "Inline",Space,Str "code",Str ":",Space,Code "<tt>",Str ",",Space,Code "@",Str "."]
29+,Para [Str "Inline",Space,Str "code",Str ":",Space,Code ("",[],[]) "<tt>",Str ",",Space,Code ("",[],[]) "@",Str "."]
3030,Header 1 [Str "Lists"]
3131,Header 2 [Str "Unordered"]
3232,Para [Str "Asterisks",Space,Str "tight",Str ":"]
tests/writer.html+3−3
@@ -1024,7 +1024,7 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'Email link'+'<\/'+'a'+'>')
10241024>Autolinks</h2
10251025><p
10261026>With an ampersand: <a href="http://example.com/?foo=1&amp;bar=2"
1027− ><code
1027+ ><code class="url"
10281028 >http://example.com/?foo=1&amp;bar=2</code
10291029 ></a
10301030 ></p
@@ -1033,7 +1033,7 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'Email link'+'<\/'+'a'+'>')
10331033 >In a list?</li
10341034 ><li
10351035 ><a href="http://example.com/"
1036− ><code
1036+ ><code class="url"
10371037 >http://example.com/</code
10381038 ></a
10391039 ></li
@@ -1054,7 +1054,7 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+
10541054><blockquote
10551055><p
10561056 >Blockquoted: <a href="http://example.com/"
1057− ><code
1057+ ><code class="url"
10581058 >http://example.com/</code
10591059 ></a
10601060 ></p
tests/writer.native+10−10
@@ -276,7 +276,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
276276,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Str "."]
277277,Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em",Str "."]]]
278278,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Str "."]
279−,Para [Str "This",Space,Str "is",Space,Str "code",Str ":",Space,Code ">",Str ",",Space,Code "$",Str ",",Space,Code "\\",Str ",",Space,Code "\\$",Str ",",Space,Code "<html>",Str "."]
279+,Para [Str "This",Space,Str "is",Space,Str "code",Str ":",Space,Code ("",[],[]) ">",Str ",",Space,Code ("",[],[]) "$",Str ",",Space,Code ("",[],[]) "\\",Str ",",Space,Code ("",[],[]) "\\$",Str ",",Space,Code ("",[],[]) "<html>",Str "."]
280280,Para [Strikeout [Str "This",Space,Str "is",Space,Emph [Str "strikeout"],Str "."]]
281281,Para [Str "Superscripts",Str ":",Space,Str "a",Superscript [Str "bc"],Str "d",Space,Str "a",Superscript [Emph [Str "hello"]],Space,Str "a",Superscript [Str "hello",Str "\160",Str "there"],Str "."]
282282,Para [Str "Subscripts",Str ":",Space,Str "H",Subscript [Str "2"],Str "O",Str ",",Space,Str "H",Subscript [Str "23"],Str "O",Str ",",Space,Str "H",Subscript [Str "many",Str "\160",Str "of",Str "\160",Str "them"],Str "O",Str "."]
@@ -287,7 +287,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
287287,Para [Quoted SingleQuote [Str "A"],Str ",",Space,Quoted SingleQuote [Str "B"],Str ",",Space,Str "and",Space,Quoted SingleQuote [Str "C"],Space,Str "are",Space,Str "letters",Str "."]
288288,Para [Quoted SingleQuote [Str "Oak",Str ","],Space,Quoted SingleQuote [Str "elm",Str ","],Space,Str "and",Space,Quoted SingleQuote [Str "beech"],Space,Str "are",Space,Str "names",Space,Str "of",Space,Str "trees",Str ".",Space,Str "So",Space,Str "is",Space,Quoted SingleQuote [Str "pine",Str "."]]
289289,Para [Quoted SingleQuote [Str "He",Space,Str "said",Str ",",Space,Quoted DoubleQuote [Str "I",Space,Str "want",Space,Str "to",Space,Str "go",Str "."]],Space,Str "Were",Space,Str "you",Space,Str "alive",Space,Str "in",Space,Str "the",Space,Str "70",Apostrophe,Str "s",Str "?"]
290−,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Quoted SingleQuote [Code "code"],Space,Str "and",Space,Str "a",Space,Quoted DoubleQuote [Link [Str "quoted",Space,Str "link"] ("http://example.com/?foo=1&bar=2","")],Str "."]
290+,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Quoted SingleQuote [Code ("",[],[]) "code"],Space,Str "and",Space,Str "a",Space,Quoted DoubleQuote [Link [Str "quoted",Space,Str "link"] ("http://example.com/?foo=1&bar=2","")],Str "."]
291291,Para [Str "Some",Space,Str "dashes",Str ":",Space,Str "one",EmDash,Str "two",Space,EmDash,Space,Str "three",EmDash,Str "four",Space,EmDash,Space,Str "five",Str "."]
292292,Para [Str "Dashes",Space,Str "between",Space,Str "numbers",Str ":",Space,Str "5",EnDash,Str "7",Str ",",Space,Str "255",EnDash,Str "66",Str ",",Space,Str "1987",EnDash,Str "1999",Str "."]
293293,Para [Str "Ellipses",Ellipses,Str "and",Ellipses,Str "and",Ellipses,Str "."]
@@ -304,10 +304,10 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
304304 ,[Plain [Str "Here",Apostrophe,Str "s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it",Str ":",Space,Math InlineMath "\\alpha + \\omega \\times x^2",Str "."]]]
305305,Para [Str "These",Space,Str "shouldn",Apostrophe,Str "t",Space,Str "be",Space,Str "math",Str ":"]
306306,BulletList
307− [[Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation",Str ",",Space,Str "write",Space,Code "$e = mc^2$",Str "."]]
307+ [[Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation",Str ",",Space,Str "write",Space,Code ("",[],[]) "$e = mc^2$",Str "."]]
308308 ,[Plain [Str "$",Str "22",Str ",",Str "000",Space,Str "is",Space,Str "a",Space,Emph [Str "lot"],Space,Str "of",Space,Str "money",Str ".",Space,Str "So",Space,Str "is",Space,Str "$",Str "34",Str ",",Str "000",Str ".",Space,Str "(",Str "It",Space,Str "worked",Space,Str "if",Space,Quoted DoubleQuote [Str "lot"],Space,Str "is",Space,Str "emphasized",Str ".",Str ")"]]
309309 ,[Plain [Str "Shoes",Space,Str "(",Str "$",Str "20",Str ")",Space,Str "and",Space,Str "socks",Space,Str "(",Str "$",Str "5",Str ")",Str "."]]
310− ,[Plain [Str "Escaped",Space,Code "$",Str ":",Space,Str "$",Str "73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23",Str "$",Str "."]]]
310+ ,[Plain [Str "Escaped",Space,Code ("",[],[]) "$",Str ":",Space,Str "$",Str "73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23",Str "$",Str "."]]]
311311,Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "LaTeX",Space,Str "table",Str ":"]
312312,RawBlock "latex" "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
313313,HorizontalRule
@@ -371,15 +371,15 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
371371,Para [Str "Here",Apostrophe,Str "s",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."]
372372,Para [Str "Here",Apostrophe,Str "s",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."]
373373,Header 2 [Str "Autolinks"]
374−,Para [Str "With",Space,Str "an",Space,Str "ampersand",Str ":",Space,Link [Code "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")]
374+,Para [Str "With",Space,Str "an",Space,Str "ampersand",Str ":",Space,Link [Code ("",["url"],[]) "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")]
375375,BulletList
376376 [[Plain [Str "In",Space,Str "a",Space,Str "list",Str "?"]]
377− ,[Plain [Link [Code "http://example.com/"] ("http://example.com/","")]]
377+ ,[Plain [Link [Code ("",["url"],[]) "http://example.com/"] ("http://example.com/","")]]
378378 ,[Plain [Str "It",Space,Str "should",Str "."]]]
379−,Para [Str "An",Space,Str "e",Str "-",Str "mail",Space,Str "address",Str ":",Space,Link [Code "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")]
379+,Para [Str "An",Space,Str "e",Str "-",Str "mail",Space,Str "address",Str ":",Space,Link [Code ("",["url"],[]) "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")]
380380,BlockQuote
381− [Para [Str "Blockquoted",Str ":",Space,Link [Code "http://example.com/"] ("http://example.com/","")]]
382−,Para [Str "Auto",Str "-",Str "links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here",Str ":",Space,Code "<http://example.com/>"]
381+ [Para [Str "Blockquoted",Str ":",Space,Link [Code ("",["url"],[]) "http://example.com/"] ("http://example.com/","")]]
382+,Para [Str "Auto",Str "-",Str "links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here",Str ":",Space,Code ("",[],[]) "<http://example.com/>"]
383383,CodeBlock ("",[],[]) "or here: <http://example.com/>"
384384,HorizontalRule
385385,Header 1 [Str "Images"]
@@ -388,7 +388,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
388388,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "movie",Space,Image [Str "movie"] ("movie.jpg",""),Space,Str "icon",Str "."]
389389,HorizontalRule
390390,Header 1 [Str "Footnotes"]
391−,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "footnote",Space,Str "reference",Str ",",Note [Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "footnote",Str ".",Space,Str "It",Space,Str "can",Space,Str "go",Space,Str "anywhere",Space,Str "after",Space,Str "the",Space,Str "footnote",Space,Str "reference",Str ".",Space,Str "It",Space,Str "need",Space,Str "not",Space,Str "be",Space,Str "placed",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "document",Str "."]],Space,Str "and",Space,Str "another",Str ".",Note [Para [Str "Here",Apostrophe,Str "s",Space,Str "the",Space,Str "long",Space,Str "note",Str ".",Space,Str "This",Space,Str "one",Space,Str "contains",Space,Str "multiple",Space,Str "blocks",Str "."],Para [Str "Subsequent",Space,Str "blocks",Space,Str "are",Space,Str "indented",Space,Str "to",Space,Str "show",Space,Str "that",Space,Str "they",Space,Str "belong",Space,Str "to",Space,Str "the",Space,Str "footnote",Space,Str "(",Str "as",Space,Str "with",Space,Str "list",Space,Str "items",Str ")",Str "."],CodeBlock ("",[],[]) " { <code> }",Para [Str "If",Space,Str "you",Space,Str "want",Str ",",Space,Str "you",Space,Str "can",Space,Str "indent",Space,Str "every",Space,Str "line",Str ",",Space,Str "but",Space,Str "you",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "lazy",Space,Str "and",Space,Str "just",Space,Str "indent",Space,Str "the",Space,Str "first",Space,Str "line",Space,Str "of",Space,Str "each",Space,Str "block",Str "."]],Space,Str "This",Space,Str "should",Space,Emph [Str "not"],Space,Str "be",Space,Str "a",Space,Str "footnote",Space,Str "reference",Str ",",Space,Str "because",Space,Str "it",Space,Str "contains",Space,Str "a",Space,Str "space",Str ".",Str "[",Str "^",Str "my",Space,Str "note",Str "]",Space,Str "Here",Space,Str "is",Space,Str "an",Space,Str "inline",Space,Str "note",Str ".",Note [Para [Str "This",Space,Str "is",Space,Emph [Str "easier"],Space,Str "to",Space,Str "type",Str ".",Space,Str "Inline",Space,Str "notes",Space,Str "may",Space,Str "contain",Space,Link [Str "links"] ("http://google.com",""),Space,Str "and",Space,Code "]",Space,Str "verbatim",Space,Str "characters",Str ",",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str "[",Str "bracketed",Space,Str "text",Str "]",Str "."]]]
391+,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "footnote",Space,Str "reference",Str ",",Note [Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "footnote",Str ".",Space,Str "It",Space,Str "can",Space,Str "go",Space,Str "anywhere",Space,Str "after",Space,Str "the",Space,Str "footnote",Space,Str "reference",Str ".",Space,Str "It",Space,Str "need",Space,Str "not",Space,Str "be",Space,Str "placed",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "document",Str "."]],Space,Str "and",Space,Str "another",Str ".",Note [Para [Str "Here",Apostrophe,Str "s",Space,Str "the",Space,Str "long",Space,Str "note",Str ".",Space,Str "This",Space,Str "one",Space,Str "contains",Space,Str "multiple",Space,Str "blocks",Str "."],Para [Str "Subsequent",Space,Str "blocks",Space,Str "are",Space,Str "indented",Space,Str "to",Space,Str "show",Space,Str "that",Space,Str "they",Space,Str "belong",Space,Str "to",Space,Str "the",Space,Str "footnote",Space,Str "(",Str "as",Space,Str "with",Space,Str "list",Space,Str "items",Str ")",Str "."],CodeBlock ("",[],[]) " { <code> }",Para [Str "If",Space,Str "you",Space,Str "want",Str ",",Space,Str "you",Space,Str "can",Space,Str "indent",Space,Str "every",Space,Str "line",Str ",",Space,Str "but",Space,Str "you",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "lazy",Space,Str "and",Space,Str "just",Space,Str "indent",Space,Str "the",Space,Str "first",Space,Str "line",Space,Str "of",Space,Str "each",Space,Str "block",Str "."]],Space,Str "This",Space,Str "should",Space,Emph [Str "not"],Space,Str "be",Space,Str "a",Space,Str "footnote",Space,Str "reference",Str ",",Space,Str "because",Space,Str "it",Space,Str "contains",Space,Str "a",Space,Str "space",Str ".",Str "[",Str "^",Str "my",Space,Str "note",Str "]",Space,Str "Here",Space,Str "is",Space,Str "an",Space,Str "inline",Space,Str "note",Str ".",Note [Para [Str "This",Space,Str "is",Space,Emph [Str "easier"],Space,Str "to",Space,Str "type",Str ".",Space,Str "Inline",Space,Str "notes",Space,Str "may",Space,Str "contain",Space,Link [Str "links"] ("http://google.com",""),Space,Str "and",Space,Code ("",[],[]) "]",Space,Str "verbatim",Space,Str "characters",Str ",",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str "[",Str "bracketed",Space,Str "text",Str "]",Str "."]]]
392392,BlockQuote
393393 [Para [Str "Notes",Space,Str "can",Space,Str "go",Space,Str "in",Space,Str "quotes",Str ".",Note [Para [Str "In",Space,Str "quote",Str "."]]]]
394394,OrderedList (1,Decimal,Period)