diff --git a/src/Text/Pandoc/Definition.hs b/src/Text/Pandoc/Definition.hs index 8b91ba322..94183c500 100644 --- a/src/Text/Pandoc/Definition.hs +++ b/src/Text/Pandoc/Definition.hs @@ -79,9 +79,10 @@ data Block -- and a list of items, each a list of blocks) | BulletList [[Block]] -- ^ Bullet list (list of items, each -- a list of blocks) - | DefinitionList [([Inline],[Block])] -- ^ Definition list - -- (list of items, each a pair of an inline list, - -- the term, and a block list) + | DefinitionList [([Inline],[[Block]])] -- ^ Definition list + -- Each list item is a pair consisting of a + -- term (a list of inlines) and one or more + -- definitions (each a list of blocks) | Header Int [Inline] -- ^ Header - level (integer) and text (inlines) | HorizontalRule -- ^ Horizontal rule | Table [Inline] [Alignment] [Double] [[Block]] [[[Block]]] -- ^ Table, diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index a38450713..e6ca05d87 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -545,12 +545,12 @@ definitionList = try $ do htmlEndTag "dl" return $ DefinitionList items -definitionListItem :: GenParser Char ParserState ([Inline], [Block]) +definitionListItem :: GenParser Char ParserState ([Inline], [[Block]]) definitionListItem = try $ do terms <- sepEndBy1 (inlinesIn "dt") spaces defs <- sepEndBy1 (blocksIn "dd") spaces let term = intercalate [LineBreak] terms - return (term, concat defs) + return (term, defs) -- -- paragraph block diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 0ae24a387..b4c01fe19 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -282,7 +282,7 @@ definitionList = try $ do items <- many listItem end "description" spaces - return (DefinitionList items) + return $ DefinitionList $ map (\(t,d) -> (t,[d])) items -- -- paragraph block diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index dc556d24f..0de700537 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -555,38 +555,61 @@ bulletList = try $ do -- definition lists -definitionListItem :: GenParser Char ParserState ([Inline], [Block]) +defListMarker :: GenParser Char ParserState () +defListMarker = do + sps <- nonindentSpaces + char ':' <|> char '~' + st <- getState + let tabStop = stateTabStop st + let remaining = tabStop - (length sps + 1) + if remaining > 0 + then count remaining (char ' ') <|> string "\t" + else pzero + return () + +definitionListItem :: GenParser Char ParserState ([Inline], [[Block]]) definitionListItem = try $ do - notFollowedBy blankline - notFollowedBy' indentSpaces -- first, see if this has any chance of being a definition list: - lookAhead (anyLine >> char ':') + lookAhead (anyLine >> optional blankline >> defListMarker) term <- manyTill inline newline + optional blankline raw <- many1 defRawBlock state <- getState let oldContext = stateParserContext state -- parse the extracted block, which may contain various block elements: - contents <- parseFromString parseBlocks $ concat raw + contents <- mapM (parseFromString parseBlocks) raw updateState (\st -> st {stateParserContext = oldContext}) return ((normalizeSpaces term), contents) defRawBlock :: GenParser Char ParserState [Char] defRawBlock = try $ do - char ':' - state <- getState - let tabStop = stateTabStop state - try (count (tabStop - 1) (char ' ')) <|> (many (char ' ') >> string "\t") + defListMarker firstline <- anyLine rawlines <- many (notFollowedBy blankline >> indentSpaces >> anyLine) trailing <- option "" blanklines - return $ firstline ++ "\n" ++ unlines rawlines ++ trailing + cont <- liftM concat $ many $ do + lns <- many1 $ notFollowedBy blankline >> indentSpaces >> anyLine + trl <- option "" blanklines + return $ unlines lns ++ trl + return $ firstline ++ "\n" ++ unlines rawlines ++ trailing ++ cont definitionList :: GenParser Char ParserState Block definitionList = do items <- many1 definitionListItem - let (terms, defs) = unzip items - let defs' = compactify defs - let items' = zip terms defs' + -- "compactify" the definition list: + let defs = map snd items + let defBlocks = reverse $ concat $ concat defs + let isPara (Para _) = True + isPara _ = False + let items' = case take 1 defBlocks of + [Para x] -> if not $ any isPara (drop 1 defBlocks) + then let (t,ds) = last items + lastDef = last ds + ds' = init ds ++ + [init lastDef ++ [Plain x]] + in init items ++ [(t, ds')] + else items + _ -> items return $ DefinitionList items' -- diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 9e38b1872..d1515c4d5 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -174,7 +174,7 @@ fieldList = try $ do else do terms <- mapM (return . (:[]) . Str . fst) remaining defs <- mapM (parseFromString (many block) . snd) remaining - return $ DefinitionList $ zip terms defs + return $ DefinitionList $ zip terms $ map (:[]) defs -- -- line block @@ -397,7 +397,7 @@ blockQuote = do list :: GenParser Char ParserState Block list = choice [ bulletList, orderedList, definitionList ] "list" -definitionListItem :: GenParser Char ParserState ([Inline], [Block]) +definitionListItem :: GenParser Char ParserState ([Inline], [[Block]]) definitionListItem = try $ do -- avoid capturing a directive or comment notFollowedBy (try $ char '.' >> char '.') @@ -405,7 +405,7 @@ definitionListItem = try $ do raw <- indentedBlock -- parse the extracted block, which may contain various block elements: contents <- parseFromString parseBlocks $ raw ++ "\n\n" - return (normalizeSpaces term, contents) + return (normalizeSpaces term, [contents]) definitionList :: GenParser Char ParserState Block definitionList = many1 definitionListItem >>= return . DefinitionList diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 0e8eff217..6f11d0200 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -796,10 +796,12 @@ prettyBlock (OrderedList attribs blockLists) = prettyBlock (BulletList blockLists) = "BulletList\n" ++ indentBy 2 0 ("[ " ++ (intercalate ", " (map (\blocks -> prettyBlockList 2 blocks) blockLists))) ++ " ]" -prettyBlock (DefinitionList blockLists) = "DefinitionList\n" ++ - indentBy 2 0 ("[" ++ (intercalate ",\n" - (map (\(term, blocks) -> " (" ++ show term ++ ",\n" ++ - indentBy 1 2 (prettyBlockList 2 blocks) ++ " )") blockLists))) ++ " ]" +prettyBlock (DefinitionList items) = "DefinitionList\n" ++ + indentBy 2 0 ("[ " ++ (intercalate "\n, " + (map (\(term, defs) -> "(" ++ show term ++ ",\n" ++ + indentBy 3 0 ("[ " ++ (intercalate ", " + (map (\blocks -> prettyBlockList 2 blocks) defs)) ++ "]") ++ + ")") items))) ++ " ]" prettyBlock (Table caption aligns widths header rows) = "Table " ++ show caption ++ " " ++ show aligns ++ " " ++ show widths ++ "\n" ++ prettyRow header ++ " [\n" ++ diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index 25902387b..142c862ef 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -31,8 +31,9 @@ module Text.Pandoc.Writers.ConTeXt ( writeConTeXt ) where import Text.Pandoc.Definition import Text.Pandoc.Shared import Text.Printf ( printf ) -import Data.List ( isSuffixOf, intercalate ) +import Data.List ( isSuffixOf, intercalate, intersperse ) import Control.Monad.State +import Control.Monad (liftM) import Text.PrettyPrint.HughesPJ hiding ( Str ) data WriterState = @@ -221,10 +222,10 @@ listItemToConTeXt :: [Block] -> State WriterState Doc listItemToConTeXt list = blockListToConTeXt list >>= return . (text "\\item" $$) . (nest 2) -defListItemToConTeXt :: ([Inline], [Block]) -> State WriterState BlockWrapper -defListItemToConTeXt (term, def) = do +defListItemToConTeXt :: ([Inline], [[Block]]) -> State WriterState BlockWrapper +defListItemToConTeXt (term, defs) = do term' <- inlineListToConTeXt term - def' <- blockListToConTeXt def + def' <- liftM (vcat . intersperse (text "")) $ mapM blockListToConTeXt defs return $ Pad $ text "\\startdescr{" <> term' <> char '}' $$ def' $$ text "\\stopdescr" -- | Convert list of block elements to ConTeXt. diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs index 13f670ab2..b4f760e6c 100644 --- a/src/Text/Pandoc/Writers/Docbook.hs +++ b/src/Text/Pandoc/Writers/Docbook.hs @@ -102,14 +102,14 @@ plainToPara x = x -- | Convert a list of pairs of terms and definitions into a list of -- Docbook varlistentrys. -deflistItemsToDocbook :: WriterOptions -> [([Inline],[Block])] -> Doc +deflistItemsToDocbook :: WriterOptions -> [([Inline],[[Block]])] -> Doc deflistItemsToDocbook opts items = - vcat $ map (\(term, def) -> deflistItemToDocbook opts term def) items + vcat $ map (\(term, defs) -> deflistItemToDocbook opts term defs) items -- | Convert a term and a list of blocks into a Docbook varlistentry. -deflistItemToDocbook :: WriterOptions -> [Inline] -> [Block] -> Doc -deflistItemToDocbook opts term def = - let def' = map plainToPara def +deflistItemToDocbook :: WriterOptions -> [Inline] -> [[Block]] -> Doc +deflistItemToDocbook opts term defs = + let def' = concatMap (map plainToPara) defs in inTagsIndented "varlistentry" $ inTagsIndented "term" (inlinesToDocbook opts term) $$ inTagsIndented "listitem" (blocksToDocbook opts def') diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 5c764a635..9e397477e 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -316,13 +316,14 @@ blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do else []) return $ ordList ! attribs $ contents blockToHtml opts (DefinitionList lst) = do - contents <- mapM (\(term, def) -> do term' <- inlineListToHtml opts term - def' <- blockListToHtml opts def - return $ (term', def')) lst + contents <- mapM (\(term, defs) -> + do term' <- liftM (dterm <<) $ inlineListToHtml opts term + defs' <- mapM (liftM (ddef <<) . blockListToHtml opts) defs + return $ term' : defs') lst let attribs = if writerIncremental opts then [theclass "incremental"] else [] - return $ defList ! attribs $ contents + return $ dlist ! attribs << concat contents blockToHtml opts (Table capt aligns widths headers rows') = do let alignStrings = map alignmentToString aligns captionDoc <- if null capt diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 0ced9d781..af23f9285 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -31,10 +31,11 @@ module Text.Pandoc.Writers.LaTeX ( writeLaTeX ) where import Text.Pandoc.Definition import Text.Pandoc.Shared import Text.Printf ( printf ) -import Data.List ( (\\), isSuffixOf, intercalate ) +import Data.List ( (\\), isSuffixOf, intercalate, intersperse ) import Data.Char ( toLower ) import qualified Data.Set as S import Control.Monad.State +import Control.Monad (liftM) import Text.PrettyPrint.HughesPJ hiding ( Str ) data WriterState = @@ -250,10 +251,10 @@ listItemToLaTeX :: [Block] -> State WriterState Doc listItemToLaTeX lst = blockListToLaTeX lst >>= return . (text "\\item" $$) . (nest 2) -defListItemToLaTeX :: ([Inline], [Block]) -> State WriterState Doc -defListItemToLaTeX (term, def) = do +defListItemToLaTeX :: ([Inline], [[Block]]) -> State WriterState Doc +defListItemToLaTeX (term, defs) = do term' <- inlineListToLaTeX $ deVerb term - def' <- blockListToLaTeX def + def' <- liftM (vcat . intersperse (text "")) $ mapM blockListToLaTeX defs return $ text "\\item[" <> term' <> text "]" $$ def' -- | Convert list of inline elements to LaTeX. diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index 616795e31..3270337d7 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -242,19 +242,19 @@ orderedListItemToMan opts num indent (first:rest) = do -- | Convert definition list item (label, list of blocks) to man. definitionListItemToMan :: WriterOptions - -> ([Inline],[Block]) + -> ([Inline],[[Block]]) -> State WriterState Doc -definitionListItemToMan opts (label, items) = do +definitionListItemToMan opts (label, defs) = do labelText <- inlineListToMan opts label - contents <- if null items + contents <- if null defs then return empty - else do - let (first, rest) = case items of + else liftM vcat $ forM defs $ \blocks -> do + let (first, rest) = case blocks of ((Para x):y) -> (Plain x,y) (x:y) -> (x,y) - [] -> error "items is null" - rest' <- mapM (\item -> blockToMan opts item) - rest >>= (return . vcat) + [] -> error "blocks is null" + rest' <- liftM vcat $ + mapM (\item -> blockToMan opts item) rest first' <- blockToMan opts first return $ first' $$ text ".RS" $$ rest' $$ text ".RE" return $ text ".TP\n.B " <> labelText $+$ contents diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index d500d4caf..31b12976d 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -279,15 +279,14 @@ orderedListItemToMarkdown opts marker items = do -- | Convert definition list item (label, list of blocks) to markdown. definitionListItemToMarkdown :: WriterOptions - -> ([Inline],[Block]) + -> ([Inline],[[Block]]) -> State WriterState Doc -definitionListItemToMarkdown opts (label, items) = do +definitionListItemToMarkdown opts (label, defs) = do labelText <- inlineListToMarkdown opts label let tabStop = writerTabStop opts let leader = char ':' - contents <- mapM (\item -> blockToMarkdown opts item >>= - (\txt -> return (leader $$ nest tabStop txt))) - items >>= return . vcat + contents <- liftM vcat $ + mapM (liftM ((leader $$) . nest tabStop . vcat) . mapM (blockToMarkdown opts)) defs return $ labelText $+$ contents -- | Convert list of Pandoc block elements to markdown. diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs index 03fae18ba..1e7194621 100644 --- a/src/Text/Pandoc/Writers/MediaWiki.hs +++ b/src/Text/Pandoc/Writers/MediaWiki.hs @@ -33,7 +33,7 @@ module Text.Pandoc.Writers.MediaWiki ( writeMediaWiki ) where import Text.Pandoc.Definition import Text.Pandoc.Shared import Text.Pandoc.XML ( escapeStringForXML ) -import Data.List ( intersect ) +import Data.List ( intersect, intercalate ) import Network.URI ( isURI ) import Control.Monad.State @@ -199,17 +199,19 @@ listItemToMediaWiki opts items = do -- | Convert definition list item (label, list of blocks) to MediaWiki. definitionListItemToMediaWiki :: WriterOptions - -> ([Inline],[Block]) + -> ([Inline],[[Block]]) -> State WriterState String definitionListItemToMediaWiki opts (label, items) = do labelText <- inlineListToMediaWiki opts label - contents <- blockListToMediaWiki opts items + contents <- mapM (blockListToMediaWiki opts) items useTags <- get >>= return . stUseTags if useTags - then return $ "
" ++ labelText ++ "
\n
" ++ contents ++ "
" + then return $ "
" ++ labelText ++ "
\n" ++ + (intercalate "\n" $ map (\d -> "
" ++ d ++ "
") contents) else do marker <- get >>= return . stListLevel - return $ marker ++ " " ++ labelText ++ "\n" ++ (init marker ++ ": ") ++ contents + return $ marker ++ " " ++ labelText ++ "\n" ++ + (intercalate "\n" $ map (\d -> init marker ++ ": " ++ d) contents) -- | True if the list can be handled by simple wiki markup, False if HTML tags will be needed. isSimpleList :: Block -> Bool @@ -218,7 +220,7 @@ isSimpleList x = BulletList items -> all isSimpleListItem items OrderedList (num, sty, _) items -> all isSimpleListItem items && num == 1 && sty `elem` [DefaultStyle, Decimal] - DefinitionList items -> all isSimpleListItem $ map snd items + DefinitionList items -> all isSimpleListItem $ concatMap snd items _ -> False -- | True if list item can be handled with the simple wiki syntax. False if diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index 7ef70a0d2..15e7f30bd 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -260,14 +260,14 @@ listItemsToOpenDocument :: String -> WriterOptions -> [[Block]] -> State WriterS listItemsToOpenDocument s o is = vcat . map (inTagsIndented "text:list-item") <$> mapM (withParagraphStyle o s . map plainToPara) is -deflistItemToOpenDocument :: WriterOptions -> ([Inline],[Block]) -> State WriterState Doc +deflistItemToOpenDocument :: WriterOptions -> ([Inline],[[Block]]) -> State WriterState Doc deflistItemToOpenDocument o (t,d) = do - let ts = if isTightList [d] + let ts = if isTightList d then "Definition_20_Term_20_Tight" else "Definition_20_Term" - ds = if isTightList [d] + ds = if isTightList d then "Definition_20_Definition_20_Tight" else "Definition_20_Definition" t' <- withParagraphStyle o ts [Para t] - d' <- withParagraphStyle o ds (map plainToPara d) + d' <- liftM vcat $ mapM (withParagraphStyle o ds . (map plainToPara)) d return $ t' $$ d' inBlockQuote :: WriterOptions -> Int -> [Block] -> State WriterState Doc diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 22d453620..31c039bd7 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -257,10 +257,10 @@ orderedListItemToRST marker items = do return $ (text marker <> char ' ') <> contents -- | Convert defintion list item (label, list of blocks) to RST. -definitionListItemToRST :: ([Inline], [Block]) -> State WriterState Doc -definitionListItemToRST (label, items) = do +definitionListItemToRST :: ([Inline], [[Block]]) -> State WriterState Doc +definitionListItemToRST (label, defs) = do label' <- inlineListToRST label - contents <- blockListToRST items + contents <- liftM vcat $ mapM blockListToRST defs tabstop <- get >>= (return . writerTabStop . stOptions) return $ label' $+$ nest tabstop contents diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs index f8bd0cd2b..2376557a8 100644 --- a/src/Text/Pandoc/Writers/RTF.hs +++ b/src/Text/Pandoc/Writers/RTF.hs @@ -247,11 +247,12 @@ listItemToRTF alignment indent marker list = -- | Convert definition list item (label, list of blocks) to RTF. definitionListItemToRTF :: Alignment -- ^ alignment -> Int -- ^ indent level - -> ([Inline],[Block]) -- ^ list item (list of blocks) + -> ([Inline],[[Block]]) -- ^ list item (list of blocks) -> [Char] -definitionListItemToRTF alignment indent (label, items) = +definitionListItemToRTF alignment indent (label, defs) = let labelText = blockToRTF indent alignment (Plain label) - itemsText = concatMap (blockToRTF (indent + listIncrement) alignment) items + itemsText = concatMap (blockToRTF (indent + listIncrement) alignment) $ + concat defs in labelText ++ itemsText -- | Convert list of inline items to RTF. diff --git a/src/Text/Pandoc/Writers/Texinfo.hs b/src/Text/Pandoc/Writers/Texinfo.hs index a0986241b..5b706d24b 100644 --- a/src/Text/Pandoc/Writers/Texinfo.hs +++ b/src/Text/Pandoc/Writers/Texinfo.hs @@ -339,11 +339,11 @@ listItemToTexinfo :: [Block] listItemToTexinfo lst = blockListToTexinfo lst >>= return . (text "@item" $$) -defListItemToTexinfo :: ([Inline], [Block]) +defListItemToTexinfo :: ([Inline], [[Block]]) -> State WriterState Doc -defListItemToTexinfo (term, def) = do +defListItemToTexinfo (term, defs) = do term' <- inlineListToTexinfo term - def' <- blockListToTexinfo def + def' <- liftM vcat $ mapM blockListToTexinfo defs return $ text "@item " <> term' <> text "\n" $$ def' -- | Convert list of inline elements to Texinfo. diff --git a/tests/html-reader.native b/tests/html-reader.native index ae371f1c0..42ba648d8 100644 --- a/tests/html-reader.native +++ b/tests/html-reader.native @@ -181,12 +181,13 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] [] "") , HorizontalRule , Header 2 [Str "Definition"] , DefinitionList - [ ([Str "Violin"], - [ Plain [Str "Stringed",Space,Str "musical",Space,Str "instrument."] - , Plain [Str "Torture",Space,Str "device."] ] ), - ([Str "Cello",LineBreak,Str "Violoncello"], - [ Plain [Str "Low-voiced",Space,Str "stringed",Space,Str "instrument."] ] - ) ] + [ ([Str "Violin"], + [ [ Plain [Str "Stringed",Space,Str "musical",Space,Str "instrument."] ] + , [ Plain [Str "Torture",Space,Str "device."] ] + ]) + , ([Str "Cello",LineBreak,Str "Violoncello"], + [ [ Plain [Str "Low-voiced",Space,Str "stringed",Space,Str "instrument."] ] + ]) ] , HorizontalRule , Header 1 [Str "HTML",Space,Str "Blocks"] , Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"] diff --git a/tests/latex-reader.native b/tests/latex-reader.native index 4a239bc07..68212071f 100644 --- a/tests/latex-reader.native +++ b/tests/latex-reader.native @@ -185,48 +185,48 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane , Header 1 [Str "Definition",Space,Str "Lists"] , Para [Str "Tight",Space,Str "using",Space,Str "spaces:"] , DefinitionList - [ ([Str "apple"], - [ Para [Str "red",Space,Str "fruit"] ] - ), - ([Str "orange"], - [ Para [Str "orange",Space,Str "fruit"] ] - ), - ([Str "banana"], - [ Para [Str "yellow",Space,Str "fruit"] ] - ) ] + [ ([Str "apple"], + [ [ Para [Str "red",Space,Str "fruit"] ] + ]) + , ([Str "orange"], + [ [ Para [Str "orange",Space,Str "fruit"] ] + ]) + , ([Str "banana"], + [ [ Para [Str "yellow",Space,Str "fruit"] ] + ]) ] , Para [Str "Tight",Space,Str "using",Space,Str "tabs:"] , DefinitionList - [ ([Str "apple"], - [ Para [Str "red",Space,Str "fruit"] ] - ), - ([Str "orange"], - [ Para [Str "orange",Space,Str "fruit"] ] - ), - ([Str "banana"], - [ Para [Str "yellow",Space,Str "fruit"] ] - ) ] + [ ([Str "apple"], + [ [ Para [Str "red",Space,Str "fruit"] ] + ]) + , ([Str "orange"], + [ [ Para [Str "orange",Space,Str "fruit"] ] + ]) + , ([Str "banana"], + [ [ Para [Str "yellow",Space,Str "fruit"] ] + ]) ] , Para [Str "Loose:"] , DefinitionList - [ ([Str "apple"], - [ Para [Str "red",Space,Str "fruit"] ] - ), - ([Str "orange"], - [ Para [Str "orange",Space,Str "fruit"] ] - ), - ([Str "banana"], - [ Para [Str "yellow",Space,Str "fruit"] ] - ) ] + [ ([Str "apple"], + [ [ Para [Str "red",Space,Str "fruit"] ] + ]) + , ([Str "orange"], + [ [ Para [Str "orange",Space,Str "fruit"] ] + ]) + , ([Str "banana"], + [ [ Para [Str "yellow",Space,Str "fruit"] ] + ]) ] , Para [Str "Multiple",Space,Str "blocks",Space,Str "with",Space,Str "italics:"] , DefinitionList - [ ([Emph [Str "apple"]], - [ Para [Str "red",Space,Str "fruit"] - , Para [Str "contains",Space,Str "seeds,",Space,Str "crisp,",Space,Str "pleasant",Space,Str "to",Space,Str "taste"] ] ), - ([Emph [Str "orange"]], - [ Para [Str "orange",Space,Str "fruit"] - , CodeBlock ("",[],[]) "{ orange code block }" - , BlockQuote - [ Para [Str "orange",Space,Str "block",Space,Str "quote"] ] - ] ) ] + [ ([Emph [Str "apple"]], + [ [ Para [Str "red",Space,Str "fruit"] + , Para [Str "contains",Space,Str "seeds,",Space,Str "crisp,",Space,Str "pleasant",Space,Str "to",Space,Str "taste"] ]]) + , ([Emph [Str "orange"]], + [ [ Para [Str "orange",Space,Str "fruit"] + , CodeBlock ("",[],[]) "{ orange code block }" + , BlockQuote + [ Para [Str "orange",Space,Str "block",Space,Str "quote"] ] + ]]) ] , Header 1 [Str "HTML",Space,Str "Blocks"] , Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"] , Para [Str "foo",Space,Str "And",Space,Str "nested",Space,Str "without",Space,Str "indentation:"] diff --git a/tests/rst-reader.native b/tests/rst-reader.native index 294be318c..22de678b3 100644 --- a/tests/rst-reader.native +++ b/tests/rst-reader.native @@ -1,8 +1,8 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite",Str ":",Space,Str "Subtitle"] ["John MacFarlane","Anonymous"] "July 17, 2006") [ DefinitionList - [ ([Str "Revision"], - [ Plain [Str "3"] ] - ) ] + [ ([Str "Revision"], + [ [ Plain [Str "3"] ] + ]) ] , Header 1 [Str "Level",Space,Str "one",Space,Str "header"] , Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc.",Space,Str "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",Space,Str "John",Space,Str "Gruber's",Space,Str "markdown",Space,Str "test",Space,Str "suite."] , Header 2 [Str "Level",Space,Str "two",Space,Str "header"] @@ -154,36 +154,36 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite",Str ":",Space,Str , [ Plain [Str "item",Space,Str "2"] ] ] , Header 2 [Str "Definition"] , DefinitionList - [ ([Str "term",Space,Str "1"], - [ Para [Str "Definition",Space,Str "1."] ] - ), - ([Str "term",Space,Str "2"], - [ Para [Str "Definition",Space,Str "2,",Space,Str "paragraph",Space,Str "1."] - , Para [Str "Definition",Space,Str "2,",Space,Str "paragraph",Space,Str "2."] ] ), - ([Str "term",Space,Str "with",Space,Emph [Str "emphasis"]], - [ Para [Str "Definition",Space,Str "3."] ] - ) ] + [ ([Str "term",Space,Str "1"], + [ [ Para [Str "Definition",Space,Str "1."] ] + ]) + , ([Str "term",Space,Str "2"], + [ [ Para [Str "Definition",Space,Str "2,",Space,Str "paragraph",Space,Str "1."] + , Para [Str "Definition",Space,Str "2,",Space,Str "paragraph",Space,Str "2."] ]]) + , ([Str "term",Space,Str "with",Space,Emph [Str "emphasis"]], + [ [ Para [Str "Definition",Space,Str "3."] ] + ]) ] , Header 1 [Str "Field",Space,Str "Lists"] , DefinitionList - [ ([Str "address"], - [ Plain [Str "61",Space,Str "Main",Space,Str "St."] ] - ), - ([Str "city"], - [ Plain [Emph [Str "Nowhere"],Str ",",Space,Str "MA,",Space,Str "USA"] ] - ), - ([Str "phone"], - [ Plain [Str "123",Str "-",Str "4567"] ] - ) ] + [ ([Str "address"], + [ [ Plain [Str "61",Space,Str "Main",Space,Str "St."] ] + ]) + , ([Str "city"], + [ [ Plain [Emph [Str "Nowhere"],Str ",",Space,Str "MA,",Space,Str "USA"] ] + ]) + , ([Str "phone"], + [ [ Plain [Str "123",Str "-",Str "4567"] ] + ]) ] , DefinitionList - [ ([Str "address"], - [ Plain [Str "61",Space,Str "Main",Space,Str "St."] ] - ), - ([Str "city"], - [ Plain [Emph [Str "Nowhere"],Str ",",Space,Str "MA,",Space,Str "USA"] ] - ), - ([Str "phone"], - [ Plain [Str "123",Str "-",Str "4567"] ] - ) ] + [ ([Str "address"], + [ [ Plain [Str "61",Space,Str "Main",Space,Str "St."] ] + ]) + , ([Str "city"], + [ [ Plain [Emph [Str "Nowhere"],Str ",",Space,Str "MA,",Space,Str "USA"] ] + ]) + , ([Str "phone"], + [ [ Plain [Str "123",Str "-",Str "4567"] ] + ]) ] , Header 1 [Str "HTML",Space,Str "Blocks"] , Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line",Str ":"] , RawHtml "
foo
\n" diff --git a/tests/testsuite.native b/tests/testsuite.native index 5f2459ffb..e58e5ff10 100644 --- a/tests/testsuite.native +++ b/tests/testsuite.native @@ -171,48 +171,79 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane , Header 1 [Str "Definition",Space,Str "Lists"] , Para [Str "Tight",Space,Str "using",Space,Str "spaces:"] , DefinitionList - [ ([Str "apple"], - [ Plain [Str "red",Space,Str "fruit"] ] - ), - ([Str "orange"], - [ Plain [Str "orange",Space,Str "fruit"] ] - ), - ([Str "banana"], - [ Plain [Str "yellow",Space,Str "fruit"] ] - ) ] + [ ([Str "apple"], + [ [ Plain [Str "red",Space,Str "fruit"] ] + ]) + , ([Str "orange"], + [ [ Plain [Str "orange",Space,Str "fruit"] ] + ]) + , ([Str "banana"], + [ [ Plain [Str "yellow",Space,Str "fruit"] ] + ]) ] , Para [Str "Tight",Space,Str "using",Space,Str "tabs:"] , DefinitionList - [ ([Str "apple"], - [ Plain [Str "red",Space,Str "fruit"] ] - ), - ([Str "orange"], - [ Plain [Str "orange",Space,Str "fruit"] ] - ), - ([Str "banana"], - [ Plain [Str "yellow",Space,Str "fruit"] ] - ) ] + [ ([Str "apple"], + [ [ Plain [Str "red",Space,Str "fruit"] ] + ]) + , ([Str "orange"], + [ [ Plain [Str "orange",Space,Str "fruit"] ] + ]) + , ([Str "banana"], + [ [ Plain [Str "yellow",Space,Str "fruit"] ] + ]) ] , Para [Str "Loose:"] , DefinitionList - [ ([Str "apple"], - [ Para [Str "red",Space,Str "fruit"] ] - ), - ([Str "orange"], - [ Para [Str "orange",Space,Str "fruit"] ] - ), - ([Str "banana"], - [ Para [Str "yellow",Space,Str "fruit"] ] - ) ] + [ ([Str "apple"], + [ [ Para [Str "red",Space,Str "fruit"] ] + ]) + , ([Str "orange"], + [ [ Para [Str "orange",Space,Str "fruit"] ] + ]) + , ([Str "banana"], + [ [ Para [Str "yellow",Space,Str "fruit"] ] + ]) ] , Para [Str "Multiple",Space,Str "blocks",Space,Str "with",Space,Str "italics:"] , DefinitionList - [ ([Emph [Str "apple"]], - [ Para [Str "red",Space,Str "fruit"] - , Para [Str "contains",Space,Str "seeds,",Space,Str "crisp,",Space,Str "pleasant",Space,Str "to",Space,Str "taste"] ] ), - ([Emph [Str "orange"]], - [ Para [Str "orange",Space,Str "fruit"] - , CodeBlock ("",[],[]) "{ orange code block }" - , BlockQuote - [ Para [Str "orange",Space,Str "block",Space,Str "quote"] ] - ] ) ] + [ ([Emph [Str "apple"]], + [ [ Para [Str "red",Space,Str "fruit"] + , Para [Str "contains",Space,Str "seeds,",Space,Str "crisp,",Space,Str "pleasant",Space,Str "to",Space,Str "taste"] ]]) + , ([Emph [Str "orange"]], + [ [ Para [Str "orange",Space,Str "fruit"] + , CodeBlock ("",[],[]) "{ orange code block }" + , BlockQuote + [ Para [Str "orange",Space,Str "block",Space,Str "quote"] ] + ]]) ] +, Para [Str "Multiple",Space,Str "definitions,",Space,Str "tight:"] +, DefinitionList + [ ([Str "apple"], + [ [ Plain [Str "red",Space,Str "fruit"] ] + , [ Plain [Str "computer"] ] + ]) + , ([Str "orange"], + [ [ Plain [Str "orange",Space,Str "fruit"] ] + , [ Plain [Str "bank"] ] + ]) ] +, Para [Str "Multiple",Space,Str "definitions,",Space,Str "loose:"] +, DefinitionList + [ ([Str "apple"], + [ [ Para [Str "red",Space,Str "fruit"] ] + , [ Para [Str "computer"] ] + ]) + , ([Str "orange"], + [ [ Para [Str "orange",Space,Str "fruit"] ] + , [ Para [Str "bank"] ] + ]) ] +, Para [Str "Blank",Space,Str "line",Space,Str "after",Space,Str "term,",Space,Str "indented",Space,Str "marker,",Space,Str "alternate",Space,Str "markers:"] +, DefinitionList + [ ([Str "apple"], + [ [ Para [Str "red",Space,Str "fruit"] ] + , [ Para [Str "computer"] ] + ]) + , ([Str "orange"], + [ [ Para [Str "orange",Space,Str "fruit"] + , OrderedList (1,Decimal,Period) + [ [ Plain [Str "sublist"] ] + , [ Plain [Str "sublist"] ] ] ]]) ] , Header 1 [Str "HTML",Space,Str "Blocks"] , Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"] , RawHtml "
" diff --git a/tests/testsuite.txt b/tests/testsuite.txt index 357739e08..6f24f02ed 100644 --- a/tests/testsuite.txt +++ b/tests/testsuite.txt @@ -300,15 +300,51 @@ Multiple blocks with italics: *apple* : red fruit -: contains seeds, + contains seeds, crisp, pleasant to taste *orange* : orange fruit -: { orange code block } + { orange code block } -: > orange block quote + > orange block quote + +Multiple definitions, tight: + +apple +: red fruit +: computer +orange +: orange fruit +: bank + +Multiple definitions, loose: + +apple +: red fruit + +: computer + +orange +: orange fruit + +: bank + +Blank line after term, indented marker, alternate markers: + +apple + + ~ red fruit + + ~ computer + +orange + + ~ orange fruit + + 1. sublist + 2. sublist # HTML Blocks diff --git a/tests/writer.context b/tests/writer.context index c5529a8df..e04b42dc0 100644 --- a/tests/writer.context +++ b/tests/writer.context @@ -514,6 +514,53 @@ orange block quote \stopblockquote \stopdescr +Multiple definitions, tight: + +\startdescr{apple} +red fruit + +computer +\stopdescr + +\startdescr{orange} +orange fruit + +bank +\stopdescr + +Multiple definitions, loose: + +\startdescr{apple} +red fruit + +computer +\stopdescr + +\startdescr{orange} +orange fruit + +bank +\stopdescr + +Blank line after term, indented marker, alternate markers: + +\startdescr{apple} +red fruit + +computer +\stopdescr + +\startdescr{orange} +orange fruit + +\startitemize[n][stopper=.] +\item + sublist +\item + sublist +\stopitemize +\stopdescr + \subject{HTML Blocks} Simple block on one line: diff --git a/tests/writer.docbook b/tests/writer.docbook index bc04d043d..75c1febf1 100644 --- a/tests/writer.docbook +++ b/tests/writer.docbook @@ -756,6 +756,108 @@ These should not be escaped: \$ \\ \> \[ \{ + + Multiple definitions, tight: + + + + + apple + + + + red fruit + + + computer + + + + + + orange + + + + orange fruit + + + bank + + + + + + Multiple definitions, loose: + + + + + apple + + + + red fruit + + + computer + + + + + + orange + + + + orange fruit + + + bank + + + + + + Blank line after term, indented marker, alternate markers: + + + + + apple + + + + red fruit + + + computer + + + + + + orange + + + + orange fruit + + + + + sublist + + + + + sublist + + + + + +
HTML Blocks diff --git a/tests/writer.html b/tests/writer.html index ece782f81..ea9c99649 100644 --- a/tests/writer.html +++ b/tests/writer.html @@ -540,6 +540,72 @@ These should not be escaped: \$ \\ \> \[ \{ >

Multiple definitions, tight:

apple
red fruit
computer
orange
orange fruit
bank

Multiple definitions, loose:

apple

red fruit

computer

orange

orange fruit

bank

Blank line after term, indented marker, alternate markers:

apple

red fruit

computer

orange

orange fruit

  1. sublist
  2. sublist

orange block quote + > orange block quote + + +Multiple definitions, tight: + +apple +: red fruit +: computer +orange +: orange fruit +: bank + +Multiple definitions, loose: + +apple +: red fruit + +: computer + +orange +: orange fruit + +: bank + + +Blank line after term, indented marker, alternate markers: + +apple +: red fruit + +: computer + +orange +: orange fruit + + 1. sublist + 2. sublist # HTML Blocks diff --git a/tests/writer.mediawiki b/tests/writer.mediawiki index fc9db6faa..4dd69708b 100644 --- a/tests/writer.mediawiki +++ b/tests/writer.mediawiki @@ -57,6 +57,7 @@ A list: # item one # item two + Nested block quotes:
nested @@ -98,31 +99,37 @@ Asterisks tight: * asterisk 1 * asterisk 2 * asterisk 3 + Asterisks loose: * asterisk 1 * asterisk 2 * asterisk 3 + Pluses tight: * Plus 1 * Plus 2 * Plus 3 + Pluses loose: * Plus 1 * Plus 2 * Plus 3 + Minuses tight: * Minus 1 * Minus 2 * Minus 3 + Minuses loose: * Minus 1 * Minus 2 * Minus 3 + === Ordered === Tight: @@ -130,21 +137,25 @@ Tight: # First # Second # Third + and: # One # Two # Three + Loose using tabs: # First # Second # Third + and using spaces: # One # Two # Three + Multiple paragraphs:
    @@ -158,6 +169,9 @@ Multiple paragraphs: * Tab ** Tab *** Tab + + + Here’s another: # First @@ -165,7 +179,9 @@ Here’s another: #* Fee #* Fie #* Foe + # Third + Same thing but with paragraphs: # First @@ -173,13 +189,17 @@ Same thing but with paragraphs: #* Fee #* Fie #* Foe + # Third + === Tabs and spaces === * this is a list item indented with tabs * this is a list item indented with spaces ** this is an example list item indented with tabs ** this is an example list item indented with spaces + + === Fancy list markers ===
      @@ -214,6 +234,8 @@ Autonumbering: # Autonumber. # More. ## Nested. + + Should not be a list item: M.A. 2007 @@ -233,6 +255,7 @@ Tight using spaces: : orange fruit ; banana : yellow fruit + Tight using tabs: ; apple @@ -241,6 +264,7 @@ Tight using tabs: : orange fruit ; banana : yellow fruit + Loose: ; apple @@ -249,6 +273,7 @@ Loose: : orange fruit ; banana : yellow fruit + Multiple blocks with italics:
      @@ -260,6 +285,35 @@ Multiple blocks with italics:
      { orange code block }

      orange block quote

      +Multiple definitions, tight: + +; apple +: red fruit +: computer +; orange +: orange fruit +: bank + +Multiple definitions, loose: + +; apple +: red fruit +: computer +; orange +: orange fruit +: bank + +Blank line after term, indented marker, alternate markers: + +; apple +: red fruit +: computer +; orange +: orange fruit +;# sublist +;# sublist + + == HTML Blocks == Simple block on one line: @@ -430,12 +484,14 @@ Ellipses…and…and…. * p-Tree * Here’s some display math: \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} * Here’s one that has a line break in it: \alpha + \omega \times x^2. + These shouldn’t be math: * To get the famous equation, write $e = mc^2$. * $22,000 is a ''lot'' of money. So is $34,000. (It worked if “lot” is emphasized.) * Shoes ($20) and socks ($5). * Escaped $: $73 ''this should be emphasized'' 23$. + Here’s a LaTeX table: @@ -452,6 +508,7 @@ Here is some unicode: * section: § * set membership: ∈ * copyright: © + AT&T has an ampersand in their name. AT&T is another way to write it. @@ -561,6 +618,7 @@ With an ampersand: http://example.com/?foo=1&bar=2 * In a list? * http://example.com/ * It should. + An e-mail address: [mailto:nobody@nowhere.net nobody@nowhere.net]
      Blockquoted: http://example.com/ @@ -598,6 +656,7 @@ If you want, you can indent every line, but you can also be lazy and just indent
      # And in list items.In list. + This paragraph should not be part of the note, as it is not indented. == Notes == diff --git a/tests/writer.native b/tests/writer.native index 5f2459ffb..e58e5ff10 100644 --- a/tests/writer.native +++ b/tests/writer.native @@ -171,48 +171,79 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane , Header 1 [Str "Definition",Space,Str "Lists"] , Para [Str "Tight",Space,Str "using",Space,Str "spaces:"] , DefinitionList - [ ([Str "apple"], - [ Plain [Str "red",Space,Str "fruit"] ] - ), - ([Str "orange"], - [ Plain [Str "orange",Space,Str "fruit"] ] - ), - ([Str "banana"], - [ Plain [Str "yellow",Space,Str "fruit"] ] - ) ] + [ ([Str "apple"], + [ [ Plain [Str "red",Space,Str "fruit"] ] + ]) + , ([Str "orange"], + [ [ Plain [Str "orange",Space,Str "fruit"] ] + ]) + , ([Str "banana"], + [ [ Plain [Str "yellow",Space,Str "fruit"] ] + ]) ] , Para [Str "Tight",Space,Str "using",Space,Str "tabs:"] , DefinitionList - [ ([Str "apple"], - [ Plain [Str "red",Space,Str "fruit"] ] - ), - ([Str "orange"], - [ Plain [Str "orange",Space,Str "fruit"] ] - ), - ([Str "banana"], - [ Plain [Str "yellow",Space,Str "fruit"] ] - ) ] + [ ([Str "apple"], + [ [ Plain [Str "red",Space,Str "fruit"] ] + ]) + , ([Str "orange"], + [ [ Plain [Str "orange",Space,Str "fruit"] ] + ]) + , ([Str "banana"], + [ [ Plain [Str "yellow",Space,Str "fruit"] ] + ]) ] , Para [Str "Loose:"] , DefinitionList - [ ([Str "apple"], - [ Para [Str "red",Space,Str "fruit"] ] - ), - ([Str "orange"], - [ Para [Str "orange",Space,Str "fruit"] ] - ), - ([Str "banana"], - [ Para [Str "yellow",Space,Str "fruit"] ] - ) ] + [ ([Str "apple"], + [ [ Para [Str "red",Space,Str "fruit"] ] + ]) + , ([Str "orange"], + [ [ Para [Str "orange",Space,Str "fruit"] ] + ]) + , ([Str "banana"], + [ [ Para [Str "yellow",Space,Str "fruit"] ] + ]) ] , Para [Str "Multiple",Space,Str "blocks",Space,Str "with",Space,Str "italics:"] , DefinitionList - [ ([Emph [Str "apple"]], - [ Para [Str "red",Space,Str "fruit"] - , Para [Str "contains",Space,Str "seeds,",Space,Str "crisp,",Space,Str "pleasant",Space,Str "to",Space,Str "taste"] ] ), - ([Emph [Str "orange"]], - [ Para [Str "orange",Space,Str "fruit"] - , CodeBlock ("",[],[]) "{ orange code block }" - , BlockQuote - [ Para [Str "orange",Space,Str "block",Space,Str "quote"] ] - ] ) ] + [ ([Emph [Str "apple"]], + [ [ Para [Str "red",Space,Str "fruit"] + , Para [Str "contains",Space,Str "seeds,",Space,Str "crisp,",Space,Str "pleasant",Space,Str "to",Space,Str "taste"] ]]) + , ([Emph [Str "orange"]], + [ [ Para [Str "orange",Space,Str "fruit"] + , CodeBlock ("",[],[]) "{ orange code block }" + , BlockQuote + [ Para [Str "orange",Space,Str "block",Space,Str "quote"] ] + ]]) ] +, Para [Str "Multiple",Space,Str "definitions,",Space,Str "tight:"] +, DefinitionList + [ ([Str "apple"], + [ [ Plain [Str "red",Space,Str "fruit"] ] + , [ Plain [Str "computer"] ] + ]) + , ([Str "orange"], + [ [ Plain [Str "orange",Space,Str "fruit"] ] + , [ Plain [Str "bank"] ] + ]) ] +, Para [Str "Multiple",Space,Str "definitions,",Space,Str "loose:"] +, DefinitionList + [ ([Str "apple"], + [ [ Para [Str "red",Space,Str "fruit"] ] + , [ Para [Str "computer"] ] + ]) + , ([Str "orange"], + [ [ Para [Str "orange",Space,Str "fruit"] ] + , [ Para [Str "bank"] ] + ]) ] +, Para [Str "Blank",Space,Str "line",Space,Str "after",Space,Str "term,",Space,Str "indented",Space,Str "marker,",Space,Str "alternate",Space,Str "markers:"] +, DefinitionList + [ ([Str "apple"], + [ [ Para [Str "red",Space,Str "fruit"] ] + , [ Para [Str "computer"] ] + ]) + , ([Str "orange"], + [ [ Para [Str "orange",Space,Str "fruit"] + , OrderedList (1,Decimal,Period) + [ [ Plain [Str "sublist"] ] + , [ Plain [Str "sublist"] ] ] ]]) ] , Header 1 [Str "HTML",Space,Str "Blocks"] , Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"] , RawHtml "
      " diff --git a/tests/writer.opendocument b/tests/writer.opendocument index 587f9efe0..5e3e848f6 100644 --- a/tests/writer.opendocument +++ b/tests/writer.opendocument @@ -498,36 +498,9 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -626,6 +599,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -825,7 +830,8 @@ - + + @@ -837,8 +843,7 @@ - - + @@ -846,22 +851,25 @@ - - - + - - + - + + + + + - + + + - + @@ -1269,6 +1277,37 @@ orange fruit { orange code block } orange block quote + Multiple definitions, + tight: + apple + red fruit + computer + orange + orange fruit + bank + Multiple definitions, + loose: + apple + red fruit + computer + orange + orange fruit + bank + Blank line after term, + indented marker, alternate markers: + apple + red fruit + computer + orange + orange fruit + + + sublist + + + sublist + + HTML Blocks Simple block on one @@ -1289,22 +1328,22 @@ foo This should be a code block, though: - <div> - foo - </div> + <div> + foo + </div> As should this: - <div>foo</div> + <div>foo</div> Now, nested: foo This should just be an HTML comment: Multiline: Code block: - <!-- Comment --> + <!-- Comment --> Just plain comment, with trailing spaces on the line: Code: - <hr /> + <hr /> Hr’s: Inline @@ -1371,46 +1410,46 @@ Ellipses…and…and…. LaTeX - + - \cite[22-23]{smith.1899} + \cite[22-23]{smith.1899} - 2+2=4 + 2+2=4 - x ∈ y + x ∈ y - α ∧ ω + α ∧ ω - 223 + 223 - p-Tree + p-Tree - Here’s some display math: \frac{d}{dx}f(x)=\limh → 0\frac{f(x+h)-f(x)}{h} + Here’s some display math: \frac{d}{dx}f(x)=\limh → 0\frac{f(x+h)-f(x)}{h} - Here’s one that has a line break in it: α+ω × x2. + Here’s one that has a line break in it: α+ω × x2. These shouldn’t be math: - + - To get the famous equation, write $e = mc^2$. + To get the famous equation, write $e = mc^2$. - $22,000 is a lot of money. So is $34,000. (It worked if “lot” is emphasized.) + $22,000 is a lot of money. So is $34,000. (It worked if “lot” is emphasized.) - Shoes ($20) and socks ($5). + Shoes ($20) and socks ($5). - Escaped $: $73 this should be emphasized 23$. + Escaped $: $73 this should be emphasized 23$. Here’s a LaTeX @@ -1425,21 +1464,21 @@ Cat & 1 \\ \hline Characters Here is some unicode: - + - I hat: Î + I hat: Î - o umlaut: ö + o umlaut: ö - section: § + section: § - set membership: ∈ + set membership: ∈ - copyright: © + copyright: © AT&T has an ampersand in @@ -1497,7 +1536,7 @@ Cat & 1 \\ \hline thrice. This should [not][] be a link. - [not]: /url + [not]: /url Foo bar. Foo @@ -1516,24 +1555,24 @@ Cat & 1 \\ \hline Autolinks With an ampersand: http://example.com/?foo=1&bar=2 - + - In a list? + In a list? - http://example.com/ + http://example.com/ - It should. + It should. An e-mail address: nobody@nowhere.net - Blockquoted: http://example.com/ + Blockquoted: http://example.com/ Auto-links should not occur here: <http://example.com/> - or here: <http://example.com/> + or here: <http://example.com/> Images From @@ -1552,7 +1591,7 @@ Cat & 1 \\ \hline another.2 Here’s the long note. This one contains multiple blocks. Subsequent blocks are indented to show that they belong to the footnote (as with list items). - { <code> } + { <code> } If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. This should not be a @@ -1560,11 +1599,11 @@ Cat & 1 \\ \hline note] Here is an inline note.3 This is easier to type. Inline notes may contain links and ] verbatim characters, as well as [bracketed text]. - Notes can go in quotes.4 + Notes can go in quotes.4 In quote. - + - And in list items.5 + And in list items.5 In list. diff --git a/tests/writer.rst b/tests/writer.rst index 408ca357c..993df642f 100644 --- a/tests/writer.rst +++ b/tests/writer.rst @@ -386,6 +386,43 @@ Multiple blocks with italics: +Multiple definitions, tight: + +apple + red fruit + computer +orange + orange fruit + bank + +Multiple definitions, loose: + +apple + red fruit + + computer + +orange + orange fruit + + bank + + +Blank line after term, indented marker, alternate markers: + +apple + red fruit + + computer + +orange + orange fruit + + + 1. sublist + 2. sublist + + HTML Blocks =========== diff --git a/tests/writer.rtf b/tests/writer.rtf index 6ee7bfae0..46ee22c28 100644 --- a/tests/writer.rtf +++ b/tests/writer.rtf @@ -181,6 +181,28 @@ These should not be escaped: \\$ \\\\ \\> \\[ \\\{\par} {\pard \ql \f0 \sa180 \li360 \fi0 orange fruit\par} {\pard \ql \f0 \sa180 \li360 \fi0 \f1 \{ orange code block \}\par} {\pard \ql \f0 \sa180 \li1080 \fi0 orange block quote\sa180\par} +{\pard \ql \f0 \sa180 \li0 \fi0 Multiple definitions, tight:\par} +{\pard \ql \f0 \sa0 \li0 \fi0 apple\par} +{\pard \ql \f0 \sa0 \li360 \fi0 red fruit\par} +{\pard \ql \f0 \sa0 \li360 \fi0 computer\par} +{\pard \ql \f0 \sa0 \li0 \fi0 orange\par} +{\pard \ql \f0 \sa0 \li360 \fi0 orange fruit\par} +{\pard \ql \f0 \sa0 \li360 \fi0 bank\sa180\par} +{\pard \ql \f0 \sa180 \li0 \fi0 Multiple definitions, loose:\par} +{\pard \ql \f0 \sa0 \li0 \fi0 apple\par} +{\pard \ql \f0 \sa180 \li360 \fi0 red fruit\par} +{\pard \ql \f0 \sa180 \li360 \fi0 computer\par} +{\pard \ql \f0 \sa0 \li0 \fi0 orange\par} +{\pard \ql \f0 \sa180 \li360 \fi0 orange fruit\par} +{\pard \ql \f0 \sa180 \li360 \fi0 bank\sa180\par} +{\pard \ql \f0 \sa180 \li0 \fi0 Blank line after term, indented marker, alternate markers:\par} +{\pard \ql \f0 \sa0 \li0 \fi0 apple\par} +{\pard \ql \f0 \sa180 \li360 \fi0 red fruit\par} +{\pard \ql \f0 \sa180 \li360 \fi0 computer\par} +{\pard \ql \f0 \sa0 \li0 \fi0 orange\par} +{\pard \ql \f0 \sa180 \li360 \fi0 orange fruit\par} +{\pard \ql \f0 \sa0 \li720 \fi-360 1.\tx360\tab sublist\par} +{\pard \ql \f0 \sa0 \li720 \fi-360 2.\tx360\tab sublist\sa180\sa180\par} {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 HTML Blocks\par} {\pard \ql \f0 \sa180 \li0 \fi0 Simple block on one line:\par} {\pard \ql \f0 \sa0 \li0 \fi0 foo\par} diff --git a/tests/writer.texinfo b/tests/writer.texinfo index 4fae5da6c..703828c7c 100644 --- a/tests/writer.texinfo +++ b/tests/writer.texinfo @@ -586,6 +586,58 @@ orange block quote @end quotation @end table +Multiple definitions@comma{} tight: + +@table @asis +@item apple + +red fruit +computer +@item orange + +orange fruit +bank +@end table + +Multiple definitions@comma{} loose: + +@table @asis +@item apple + +red fruit + +computer + +@item orange + +orange fruit + +bank + +@end table + +Blank line after term@comma{} indented marker@comma{} alternate markers: + +@table @asis +@item apple + +red fruit + +computer + +@item orange + +orange fruit + +@enumerate +@item +sublist +@item +sublist +@end enumerate + +@end table + @node HTML Blocks @chapter HTML Blocks