From 5ba0dbe976657b3dbb8890ce7cd71a2f454948c1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 27 Oct 2025 22:25:18 +0100 Subject: Djot reader: add Space elements. Previously we just got big Str elements with spaces included. But many pandoc writers assume that breakable spaces will be Space elements. So, we got odd results with e.g. jira output. Closes #11250. --- src/Text/Pandoc/Readers/Djot.hs | 2 +- test/djot-reader.native | 1908 +++++++++++++++++++++++++++++++++------ 2 files changed, 1625 insertions(+), 285 deletions(-) diff --git a/src/Text/Pandoc/Readers/Djot.hs b/src/Text/Pandoc/Readers/Djot.hs index 7bf360172..ecfe3e2c1 100644 --- a/src/Text/Pandoc/Readers/Djot.hs +++ b/src/Text/Pandoc/Readers/Djot.hs @@ -186,7 +186,7 @@ convertInlines = fmap mconcat . mapM convertInline . F.toList . D.unMany convertInline :: PandocMonad m => D.Node D.Inline -> ReaderT Env m Inlines convertInline (D.Node pos attr il) = addAttrToInline pos attr <$> case il of - D.Str bs -> pure $ str (UTF8.toText bs) + D.Str bs -> pure $ text (UTF8.toText bs) D.Emph ils -> emph <$> convertInlines ils D.Strong ils -> strong <$> convertInlines ils D.Highlight ils -> spanWith ("",["mark"],[]) <$> convertInlines ils diff --git a/test/djot-reader.native b/test/djot-reader.native index bd0ae351f..8f7cc8174 100644 --- a/test/djot-reader.native +++ b/test/djot-reader.native @@ -2,15 +2,57 @@ Pandoc Meta { unMeta = fromList [] } [ Div ( "Pandoc-Test-Suite" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "Pandoc Test Suite" ] + [ Header + 1 + ( "" , [] , [] ) + [ Str "Pandoc" , Space , Str "Test" , Space , Str "Suite" ] + , Para + [ Str "John" + , Space + , Str "MacFarlane" + , SoftBreak + , Str "Anonymous" + ] , Para - [ Str "John MacFarlane" , SoftBreak , Str "Anonymous" ] - , Para [ Str "July 17, 2006" ] + [ Str "July" , Space , Str "17," , Space , Str "2006" ] , Para - [ Str - "This is a set of tests for pandoc. Most of them are adapted from John Gruber\8217s" + [ 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\8217s" , SoftBreak - , Str "markdown test suite." + , Str "markdown" + , Space + , Str "test" + , Space + , Str "suite." ] , HorizontalRule ] @@ -22,10 +64,17 @@ Pandoc [ Header 2 ( "" , [] , [] ) - [ Str "Level 2 with an " + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Str "an" + , Space , Link ( "" , [] , [] ) - [ Str "embedded link" ] + [ Str "embedded" , Space , Str "link" ] ( "/url" , "" ) ] , Div @@ -33,55 +82,179 @@ Pandoc [ Header 3 ( "" , [] , [] ) - [ Str "Level 3 with " , Emph [ Str "emphasis" ] ] + [ Str "Level" + , Space + , Str "3" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] , Div ( "level-4" , [ "section" ] , [] ) - [ Header 4 ( "" , [] , [] ) [ Str "Level 4" ] + [ Header + 4 + ( "" , [] , [] ) + [ Str "Level" , Space , Str "4" ] , Div ( "level-5" , [ "section" ] , [] ) - [ Header 5 ( "" , [] , [] ) [ Str "Level 5" ] ] + [ Header + 5 + ( "" , [] , [] ) + [ Str "Level" , Space , Str "5" ] + ] ] ] ] ] , Div ( "level-1" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "Level 1" ] + [ Header + 1 ( "" , [] , [] ) [ Str "Level" , Space , Str "1" ] , Div ( "level-2-with-emphasis" , [ "section" ] , [] ) [ Header 2 ( "" , [] , [] ) - [ Str "Level 2 with " , Emph [ Str "emphasis" ] ] + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] , Div ( "level-3" , [ "section" ] , [] ) - [ Header 3 ( "" , [] , [] ) [ Str "Level 3" ] - , Para [ Str "with no blank line" ] + [ Header + 3 ( "" , [] , [] ) [ Str "Level" , Space , Str "3" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] ] ] , Div ( "level-2" , [ "section" ] , [] ) - [ Header 2 ( "" , [] , [] ) [ Str "Level 2" ] - , Para [ Str "with no blank line" ] + [ Header + 2 ( "" , [] , [] ) [ Str "Level" , Space , Str "2" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] , HorizontalRule ] ] , Div ( "paragraphs" , [ "section" ] , [] ) [ Header 1 ( "" , [] , [] ) [ Str "Paragraphs" ] - , Para [ Str "Here\8217s a regular paragraph." ] , Para - [ Str - "In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item." + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , Space + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." , SoftBreak - , Str - "Because a hard-wrapped line in the middle of a paragraph looked like a list" + , Str "Because" + , Space + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "middle" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "looked" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "list" , SoftBreak , Str "item." ] - , Para [ Str "Here\8217s one with a bullet. * criminey." ] , Para - [ Str "There should be a hard line break" + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , Space + , Str "*" + , Space + , Str "criminey." + ] + , Para + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "hard" + , Space + , Str "line" + , Space + , Str "break" , LineBreak , Str "here." ] @@ -89,33 +262,97 @@ Pandoc ] , Div ( "block-quotes" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "Block Quotes" ] - , Para [ Str "E-mail style:" ] + [ Header + 1 ( "" , [] , [] ) [ Str "Block" , Space , Str "Quotes" ] + , Para [ Str "E-mail" , Space , Str "style:" ] , BlockQuote - [ Para [ Str "This is a block quote. It is pretty short." ] + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , Space + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] ] , BlockQuote - [ Para [ Str "Code in a block quote:" ] + [ Para + [ Str "Code" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] , CodeBlock ( "" , [ "" ] , [] ) "sub status {\n print \"working\";\n}\n" - , Para [ Str "A list:" ] + , Para [ Str "A" , Space , Str "list:" ] , OrderedList ( 1 , Decimal , Period ) - [ [ Plain [ Str "item one" ] ] - , [ Plain [ Str "item two" ] ] + [ [ Plain [ Str "item" , Space , Str "one" ] ] + , [ Plain [ Str "item" , Space , Str "two" ] ] + ] + , Para + [ Str "Nested" + , Space + , Str "block" + , Space + , Str "quotes:" ] - , Para [ Str "Nested block quotes:" ] , BlockQuote [ Para [ Str "nested" ] ] , BlockQuote [ Para [ Str "nested" ] ] ] - , Para [ Str "This should not be a block quote: 2 > 1." ] - , Para [ Str "And a following paragraph." ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + , Space + , Str "2" + , Space + , Str ">" + , Space + , Str "1." + ] + , Para + [ Str "And" + , Space + , Str "a" + , Space + , Str "following" + , Space + , Str "paragraph." + ] , HorizontalRule ] , Div ( "code-blocks" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "Code Blocks" ] + [ Header + 1 ( "" , [] , [] ) [ Str "Code" , Space , Str "Blocks" ] , Para [ Str "Code:" ] , CodeBlock ( "" , [ "" ] , [] ) @@ -132,41 +369,41 @@ Pandoc , Div ( "unordered" , [ "section" ] , [] ) [ Header 2 ( "" , [] , [] ) [ Str "Unordered" ] - , Para [ Str "Asterisks tight:" ] + , Para [ Str "Asterisks" , Space , Str "tight:" ] , BulletList - [ [ Plain [ Str "asterisk 1" ] ] - , [ Plain [ Str "asterisk 2" ] ] - , [ Plain [ Str "asterisk 3" ] ] + [ [ Plain [ Str "asterisk" , Space , Str "1" ] ] + , [ Plain [ Str "asterisk" , Space , Str "2" ] ] + , [ Plain [ Str "asterisk" , Space , Str "3" ] ] ] - , Para [ Str "Asterisks loose:" ] + , Para [ Str "Asterisks" , Space , Str "loose:" ] , BulletList - [ [ Para [ Str "asterisk 1" ] ] - , [ Para [ Str "asterisk 2" ] ] - , [ Para [ Str "asterisk 3" ] ] + [ [ Para [ Str "asterisk" , Space , Str "1" ] ] + , [ Para [ Str "asterisk" , Space , Str "2" ] ] + , [ Para [ Str "asterisk" , Space , Str "3" ] ] ] - , Para [ Str "Pluses tight:" ] + , Para [ Str "Pluses" , Space , Str "tight:" ] , BulletList - [ [ Plain [ Str "Plus 1" ] ] - , [ Plain [ Str "Plus 2" ] ] - , [ Plain [ Str "Plus 3" ] ] + [ [ Plain [ Str "Plus" , Space , Str "1" ] ] + , [ Plain [ Str "Plus" , Space , Str "2" ] ] + , [ Plain [ Str "Plus" , Space , Str "3" ] ] ] - , Para [ Str "Pluses loose:" ] + , Para [ Str "Pluses" , Space , Str "loose:" ] , BulletList - [ [ Para [ Str "Plus 1" ] ] - , [ Para [ Str "Plus 2" ] ] - , [ Para [ Str "Plus 3" ] ] + [ [ Para [ Str "Plus" , Space , Str "1" ] ] + , [ Para [ Str "Plus" , Space , Str "2" ] ] + , [ Para [ Str "Plus" , Space , Str "3" ] ] ] - , Para [ Str "Minuses tight:" ] + , Para [ Str "Minuses" , Space , Str "tight:" ] , BulletList - [ [ Plain [ Str "Minus 1" ] ] - , [ Plain [ Str "Minus 2" ] ] - , [ Plain [ Str "Minus 3" ] ] + [ [ Plain [ Str "Minus" , Space , Str "1" ] ] + , [ Plain [ Str "Minus" , Space , Str "2" ] ] + , [ Plain [ Str "Minus" , Space , Str "3" ] ] ] - , Para [ Str "Minuses loose:" ] + , Para [ Str "Minuses" , Space , Str "loose:" ] , BulletList - [ [ Para [ Str "Minus 1" ] ] - , [ Para [ Str "Minus 2" ] ] - , [ Para [ Str "Minus 3" ] ] + [ [ Para [ Str "Minus" , Space , Str "1" ] ] + , [ Para [ Str "Minus" , Space , Str "2" ] ] + , [ Para [ Str "Minus" , Space , Str "3" ] ] ] ] , Div @@ -186,31 +423,76 @@ Pandoc , [ Plain [ Str "Two" ] ] , [ Plain [ Str "Three" ] ] ] - , Para [ Str "Loose using tabs:" ] + , Para + [ Str "Loose" + , Space + , Str "using" + , Space + , Str "tabs:" + ] , OrderedList ( 1 , Decimal , Period ) [ [ Para [ Str "First" ] ] , [ Para [ Str "Second" ] ] , [ Para [ Str "Third" ] ] ] - , Para [ Str "and using spaces:" ] + , Para + [ Str "and" + , Space + , Str "using" + , Space + , Str "spaces:" + ] , OrderedList ( 1 , Decimal , Period ) [ [ Para [ Str "One" ] ] , [ Para [ Str "Two" ] ] , [ Para [ Str "Three" ] ] ] - , Para [ Str "Multiple paragraphs:" ] + , Para [ Str "Multiple" , Space , Str "paragraphs:" ] , OrderedList ( 1 , Decimal , Period ) - [ [ Para [ Str "Item 1, graf one." ] + [ [ Para + [ Str "Item" + , Space + , Str "1," + , Space + , Str "graf" + , Space + , Str "one." + ] , Para - [ Str - "Item 1. graf two. The quick brown fox jumped over the lazy dog\8217s back." + [ Str "Item" + , Space + , Str "1." + , Space + , Str "graf" + , Space + , Str "two." + , Space + , Str "The" + , Space + , Str "quick" + , Space + , Str "brown" + , Space + , Str "fox" + , Space + , Str "jumped" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , Space + , Str "dog\8217s" + , Space + , Str "back." ] ] - , [ Para [ Str "Item 2." ] ] - , [ Para [ Str "Item 3." ] ] + , [ Para [ Str "Item" , Space , Str "2." ] ] + , [ Para [ Str "Item" , Space , Str "3." ] ] ] ] , Div @@ -225,7 +507,7 @@ Pandoc ] ] ] - , Para [ Str "Here\8217s another:" ] + , Para [ Str "Here\8217s" , Space , Str "another:" ] , OrderedList ( 1 , Decimal , Period ) [ [ Plain [ Str "First" ] ] @@ -238,7 +520,17 @@ Pandoc ] , [ Plain [ Str "Third" ] ] ] - , Para [ Str "Same thing but with paragraphs:" ] + , Para + [ Str "Same" + , Space + , Str "thing" + , Space + , Str "but" + , Space + , Str "with" + , Space + , Str "paragraphs:" + ] , OrderedList ( 1 , Decimal , Period ) [ [ Para [ Str "First" ] ] @@ -254,21 +546,85 @@ Pandoc ] , Div ( "tabs-and-spaces" , [ "section" ] , [] ) - [ Header 2 ( "" , [] , [] ) [ Str "Tabs and spaces" ] + [ Header + 2 + ( "" , [] , [] ) + [ Str "Tabs" , Space , Str "and" , Space , Str "spaces" ] , BulletList - [ [ Para [ Str "this is a list item indented with tabs" ] + [ [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] ] , [ Para - [ Str "this is a list item indented with spaces" ] + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] , BulletList [ [ Para - [ Str - "this is an example list item indented with tabs" + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" ] ] , [ Para - [ Str - "this is an example list item indented with spaces" + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" ] ] ] @@ -277,24 +633,61 @@ Pandoc ] , Div ( "fancy-list-markers" , [ "section" ] , [] ) - [ Header 2 ( "" , [] , [] ) [ Str "Fancy list markers" ] + [ Header + 2 + ( "" , [] , [] ) + [ Str "Fancy" + , Space + , Str "list" + , Space + , Str "markers" + ] , OrderedList ( 2 , Decimal , TwoParens ) - [ [ Para [ Str "begins with 2" ] ] - , [ Para [ Str "and now 3" ] - , Para [ Str "with a continuation" ] + [ [ Para + [ Str "begins" + , Space + , Str "with" + , Space + , Str "2" + ] + ] + , [ Para + [ Str "and" , Space , Str "now" , Space , Str "3" ] + , Para + [ Str "with" + , Space + , Str "a" + , Space + , Str "continuation" + ] , OrderedList ( 4 , LowerRoman , Period ) [ [ Plain - [ Str - "sublist with roman numerals, starting with 4" + [ Str "sublist" + , Space + , Str "with" + , Space + , Str "roman" + , Space + , Str "numerals," + , Space + , Str "starting" + , Space + , Str "with" + , Space + , Str "4" ] ] - , [ Plain [ Str "more items" ] + , [ Plain [ Str "more" , Space , Str "items" ] , OrderedList ( 1 , UpperAlpha , TwoParens ) - [ [ Plain [ Str "a subsublist" ] ] - , [ Plain [ Str "a subsublist" ] ] + [ [ Plain + [ Str "a" , Space , Str "subsublist" ] + ] + , [ Plain + [ Str "a" , Space , Str "subsublist" ] + ] ] ] ] @@ -303,17 +696,32 @@ Pandoc , Para [ Str "Nesting:" ] , OrderedList ( 1 , UpperAlpha , Period ) - [ [ Plain [ Str "Upper Alpha" ] + [ [ Plain [ Str "Upper" , Space , Str "Alpha" ] , OrderedList ( 1 , UpperRoman , Period ) - [ [ Plain [ Str "Upper Roman." ] + [ [ Plain [ Str "Upper" , Space , Str "Roman." ] , OrderedList ( 6 , Decimal , TwoParens ) - [ [ Plain [ Str "Decimal start with 6" ] + [ [ Plain + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] , OrderedList ( 3 , LowerAlpha , OneParen ) [ [ Plain - [ Str "Lower alpha with paren" ] + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] ] ] ] @@ -332,7 +740,19 @@ Pandoc [ [ Plain [ Str "Nested." ] ] ] ] ] - , Para [ Str "Should not be a list item:" ] + , Para + [ Str "Should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item:" + ] , Para [ Str "M.A.\160\&2007" ] , OrderedList ( 2 , UpperAlpha , Period ) @@ -342,79 +762,166 @@ Pandoc ] , Div ( "definition-lists" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "Definition Lists" ] - , Para [ Str "Tight using spaces:" ] + [ Header + 1 + ( "" , [] , [] ) + [ Str "Definition" , Space , Str "Lists" ] + , Para + [ Str "Tight" + , Space + , Str "using" + , Space + , Str "spaces:" + ] , DefinitionList - [ ( [ Str "apple" ] , [ [ Plain [ Str "red fruit" ] ] ] ) + [ ( [ Str "apple" ] + , [ [ Plain [ Str "red" , Space , Str "fruit" ] ] ] + ) , ( [ Str "orange" ] - , [ [ Plain [ Str "orange fruit" ] ] ] + , [ [ Plain [ Str "orange" , Space , Str "fruit" ] ] ] ) , ( [ Str "banana" ] - , [ [ Plain [ Str "yellow fruit" ] ] ] + , [ [ Plain [ Str "yellow" , Space , Str "fruit" ] ] ] ) ] - , Para [ Str "Tight using tabs:" ] + , Para + [ Str "Tight" , Space , Str "using" , Space , Str "tabs:" ] , DefinitionList - [ ( [ Str "apple" ] , [ [ Plain [ Str "red fruit" ] ] ] ) + [ ( [ Str "apple" ] + , [ [ Plain [ Str "red" , Space , Str "fruit" ] ] ] + ) , ( [ Str "orange" ] - , [ [ Plain [ Str "orange fruit" ] ] ] + , [ [ Plain [ Str "orange" , Space , Str "fruit" ] ] ] ) , ( [ Str "banana" ] - , [ [ Plain [ Str "yellow fruit" ] ] ] + , [ [ Plain [ Str "yellow" , Space , Str "fruit" ] ] ] ) ] , Para [ Str "Loose:" ] , DefinitionList - [ ( [ Str "apple" ] , [ [ Para [ Str "red fruit" ] ] ] ) - , ( [ Str "orange" ] , [ [ Para [ Str "orange fruit" ] ] ] ) - , ( [ Str "banana" ] , [ [ Para [ Str "yellow 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:" ] - , Para [ Str "Multiple blocks with italics:" ] , DefinitionList [ ( [ Emph [ Str "apple" ] ] - , [ [ Para [ Str "red fruit" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] , Para - [ Str "contains seeds, crisp, pleasant to taste" ] + [ Str "contains" + , Space + , Str "seeds," + , Space + , Str "crisp," + , Space + , Str "pleasant" + , Space + , Str "to" + , Space + , Str "taste" + ] ] ] ) , ( [ Emph [ Str "orange" ] ] - , [ [ Para [ Str "orange fruit" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] , CodeBlock ( "" , [ "" ] , [] ) "{ orange code block }\n" - , BlockQuote [ Para [ Str "orange block quote" ] ] + , BlockQuote + [ Para + [ Str "orange" + , Space + , Str "block" + , Space + , Str "quote" + ] + ] ] ] ) ] - , Para [ Str "Multiple definitions, tight:" ] + , Para + [ Str "Multiple" + , Space + , Str "definitions," + , Space + , Str "tight:" + ] , DefinitionList [ ( [ Str "apple" ] - , [ [ Para [ Str "red fruit" ] , Para [ Str "computer" ] ] ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] + , Para [ Str "computer" ] + ] + ] ) , ( [ Str "orange" ] - , [ [ Para [ Str "orange fruit" ] , Para [ Str "bank" ] ] ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] + , Para [ Str "bank" ] + ] + ] ) ] - , Para [ Str "Multiple definitions, loose:" ] + , Para + [ Str "Multiple" + , Space + , Str "definitions," + , Space + , Str "loose:" + ] , DefinitionList [ ( [ Str "apple" ] - , [ [ Para [ Str "red fruit" ] , Para [ Str "computer" ] ] ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] + , Para [ Str "computer" ] + ] + ] ) , ( [ Str "orange" ] - , [ [ Para [ Str "orange fruit" ] , Para [ Str "bank" ] ] ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] + , Para [ Str "bank" ] + ] + ] ) ] , Para - [ Str - "Blank line after term, indented marker, alternate markers:" + [ 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 fruit" ] , Para [ Str "computer" ] ] ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] + , Para [ Str "computer" ] + ] + ] ) , ( [ Str "orange" ] - , [ [ Para [ Str "orange fruit" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] , OrderedList ( 1 , Decimal , Period ) [ [ Plain [ Str "sublist" ] ] @@ -427,10 +934,29 @@ Pandoc ] , Div ( "html-blocks" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "HTML Blocks" ] - , Para [ Str "Simple block on one line:" ] + [ Header + 1 ( "" , [] , [] ) [ Str "HTML" , Space , Str "Blocks" ] + , Para + [ Str "Simple" + , Space + , Str "block" + , Space + , Str "on" + , Space + , Str "one" + , Space + , Str "line:" + ] , Div ( "" , [] , [] ) [ Para [ Str "foo" ] ] - , Para [ Str "And nested without indentation:" ] + , Para + [ Str "And" + , Space + , Str "nested" + , Space + , Str "without" + , Space + , Str "indentation:" + ] , Div ( "" , [] , [] ) [ Div @@ -438,29 +964,105 @@ Pandoc [ Div ( "" , [] , [] ) [ Para [ Str "foo" ] ] ] , Div ( "" , [] , [] ) [ Para [ Str "bar" ] ] ] - , Para [ Str "Interpreted markdown in a table:" ] - , Para [ Str "This is " , Emph [ Str "emphasized" ] ] - , Para [ Str "And this is " , Strong [ Str "strong" ] ] - , Para [ Str "Here\8217s a simple block:" ] + , Para + [ Str "Interpreted" + , Space + , Str "markdown" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "table:" + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "emphasized" ] + ] + , Para + [ Str "And" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Strong [ Str "strong" ] + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "simple" + , Space + , Str "block:" + ] , Div ( "" , [] , [] ) [ Para [ Str "foo" ] ] - , Para [ Str "This should be a code block, though:" ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "code" + , Space + , Str "block," + , Space + , Str "though:" + ] , CodeBlock ( "" , [ "" ] , [] ) "
\n foo\n
\n" - , Para [ Str "As should this:" ] + , Para + [ Str "As" , Space , Str "should" , Space , Str "this:" ] , CodeBlock ( "" , [ "" ] , [] ) "
foo
\n" - , Para [ Str "Now, nested:" ] + , Para [ Str "Now," , Space , Str "nested:" ] , Div ( "" , [] , [] ) [ Div ( "" , [] , [] ) [ Div ( "" , [] , [] ) [ Para [ Str "foo" ] ] ] ] - , Para [ Str "This should just be an HTML comment:" ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "just" + , Space + , Str "be" + , Space + , Str "an" + , Space + , Str "HTML" + , Space + , Str "comment:" + ] , Para [ Str "Multiline:" ] - , Para [ Str "Code block:" ] + , Para [ Str "Code" , Space , Str "block:" ] , CodeBlock ( "" , [ "" ] , [] ) "\n" , Para - [ Str - "Just plain comment, with trailing spaces on the line:" + [ Str "Just" + , Space + , Str "plain" + , Space + , Str "comment," + , Space + , Str "with" + , Space + , Str "trailing" + , Space + , Str "spaces" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "line:" ] , Para [ Str "Code:" ] , CodeBlock ( "" , [ "" ] , [] ) "
\n" @@ -469,49 +1071,110 @@ Pandoc ] , Div ( "inline-markup" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "Inline Markup" ] + [ Header + 1 ( "" , [] , [] ) [ Str "Inline" , Space , Str "Markup" ] , Para - [ Str "This is " + [ Str "This" + , Space + , Str "is" + , Space , Emph [ Str "emphasized" ] - , Str ", and so " - , Emph [ Str "is this" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Emph [ Str "is" , Space , Str "this" ] , Str "." ] , Para - [ Str "This is " + [ Str "This" + , Space + , Str "is" + , Space , Strong [ Str "strong" ] - , Str ", and so " - , Strong [ Str "is this" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Strong [ Str "is" , Space , Str "this" ] , Str "." ] , Para - [ Str "An " + [ Str "An" + , Space , Emph [ Link ( "" , [] , [] ) - [ Str "emphasized link" ] + [ Str "emphasized" , Space , Str "link" ] ( "/url" , "" ) ] , Str "." ] - , Para [ Strong [ Emph [ Str "This is strong and em." ] ] ] , Para - [ Str "So is " + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space , Strong [ Emph [ Str "this" ] ] - , Str " word." + , Space + , Str "word." ] - , Para [ Strong [ Emph [ Str "This is strong and em." ] ] ] , Para - [ Str "So is " + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space , Strong [ Emph [ Str "this" ] ] - , Str " word." + , Space + , Str "word." ] , Para - [ Str "This is code: " + [ Str "This" + , Space + , Str "is" + , Space + , Str "code:" + , Space , Code ( "" , [] , [] ) ">" - , Str ", " + , Str "," + , Space , Code ( "" , [] , [] ) "$" - , Str ", " + , Str "," + , Space , Code ( "" , [] , [] ) "\\`, " , Str "$" , Code ( "" , [] , [] ) ", " @@ -521,76 +1184,195 @@ Pandoc , Para [ Span ( "" , [ "deleted" ] , [] ) - [ Str "This is " , Emph [ Str "strikeout" ] , Str "." ] + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "strikeout" ] + , Str "." + ] ] , Para - [ Str "Superscripts: a" + [ Str "Superscripts:" + , Space + , Str "a" , Superscript [ Str "bc" ] - , Str "d a" + , Str "d" + , Space + , Str "a" , Superscript [ Emph [ Str "hello" ] ] - , Str " a" + , Space + , Str "a" , Superscript [ Str "hello\160there" ] , Str "." ] , Para - [ Str "Subscripts: H" + [ Str "Subscripts:" + , Space + , Str "H" , Subscript [ Str "2" ] - , Str "O, H" + , Str "O," + , Space + , Str "H" , Subscript [ Str "23" ] - , Str "O, H" + , Str "O," + , Space + , Str "H" , Subscript [ Str "many\160of\160them" ] , Str "O." ] , Para - [ Str - "These should not be superscripts or subscripts, because of the unescaped spaces:" + [ Str "These" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "superscripts" + , Space + , Str "or" + , Space + , Str "subscripts," + , Space + , Str "because" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "unescaped" + , Space + , Str "spaces:" , SoftBreak - , Str "a^b c^d, a~b c~d." + , Str "a^b" + , Space + , Str "c^d," + , Space + , Str "a~b" + , Space + , Str "c~d." ] , HorizontalRule ] , Div ( "smart-quotes-ellipses-dashes" , [ "section" ] , [] ) [ Header - 1 ( "" , [] , [] ) [ Str "Smart quotes, ellipses, dashes" ] + 1 + ( "" , [] , [] ) + [ Str "Smart" + , Space + , Str "quotes," + , Space + , Str "ellipses," + , Space + , Str "dashes" + ] , Para [ Quoted DoubleQuote [ Str "Hello," ] - , Str " said the spider. " + , Space + , Str "said" + , Space + , Str "the" + , Space + , Str "spider." + , Space , Quoted DoubleQuote [ Quoted SingleQuote [ Str "Shelob" ] - , Str " is my name." + , Space + , Str "is" + , Space + , Str "my" + , Space + , Str "name." ] ] , Para [ Quoted SingleQuote [ Str "A" ] - , Str ", " + , Str "," + , Space , Quoted SingleQuote [ Str "B" ] - , Str ", and " + , Str "," + , Space + , Str "and" + , Space , Quoted SingleQuote [ Str "C" ] - , Str " are letters." + , Space + , Str "are" + , Space + , Str "letters." ] , Para [ Quoted SingleQuote [ Str "Oak," ] - , Str " " + , Space , Quoted SingleQuote [ Str "elm," ] - , Str " and " + , Space + , Str "and" + , Space , Quoted SingleQuote [ Str "beech" ] - , Str " are names of trees. So is " + , Space + , Str "are" + , Space + , Str "names" + , Space + , Str "of" + , Space + , Str "trees." + , Space + , Str "So" + , Space + , Str "is" + , Space , Quoted SingleQuote [ Str "pine." ] ] , Para [ Quoted SingleQuote - [ Str "He said, " - , Quoted DoubleQuote [ Str "I want to go." ] + [ Str "He" + , Space + , Str "said," + , Space + , Quoted + DoubleQuote + [ Str "I" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "go." + ] ] - , Str " Were you alive in the 70\8217s?" + , Space + , Str "Were" + , Space + , Str "you" + , Space + , Str "alive" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "70\8217s?" ] , Para - [ Str "Here is some quoted " + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "quoted" + , Space , Quoted SingleQuote [ Code ( "" , [] , [] ) "code" ] - , Str " and a " + , Space + , Str "and" + , Space + , Str "a" + , Space , Quoted DoubleQuote [ Link @@ -601,12 +1383,32 @@ Pandoc , Str "." ] , Para - [ Str - "Some dashes: one\8212two \8212 three\8212four \8212 five." + [ Str "Some" + , Space + , Str "dashes:" + , Space + , Str "one\8212two" + , Space + , Str "\8212" + , Space + , Str "three\8212four" + , Space + , Str "\8212" + , Space + , Str "five." ] , Para - [ Str - "Dashes between numbers: 5\8211\&7, 255\8211\&66, 1987\8211\&1999." + [ Str "Dashes" + , Space + , Str "between" + , Space + , Str "numbers:" + , Space + , Str "5\8211\&7," + , Space + , Str "255\8211\&66," + , Space + , Str "1987\8211\&1999." ] , Para [ Str "Ellipses\8230and\8230and\8230." ] , HorizontalRule @@ -622,7 +1424,13 @@ Pandoc , [ Plain [ Math InlineMath "223" ] ] , [ Plain [ Math InlineMath "p" , Str "-Tree" ] ] , [ Plain - [ Str "Here\8217s some display math:" + [ Str "Here\8217s" + , Space + , Str "some" + , Space + , Str "display" + , Space + , Str "math:" , SoftBreak , Math DisplayMath @@ -630,75 +1438,222 @@ Pandoc ] ] , [ Plain - [ Str "Here\8217s one that has a line break in it: " + [ Str "Here\8217s" + , 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 "." ] ] ] - , Para [ Str "These shouldn\8217t be math:" ] + , Para + [ Str "These" + , Space + , Str "shouldn\8217t" + , Space + , Str "be" + , Space + , Str "math:" + ] , BulletList [ [ Plain - [ Str "To get the famous equation, write " + [ Str "To" + , Space + , Str "get" + , Space + , Str "the" + , Space + , Str "famous" + , Space + , Str "equation," + , Space + , Str "write" + , Space , Code ( "" , [] , [] ) "$e = mc^2$" , Str "." ] ] , [ Plain - [ Str "$22,000 is a " + [ Str "$22,000" + , Space + , Str "is" + , Space + , Str "a" + , Space , Emph [ Str "lot" ] - , Str " of money. So is $34,000. (It worked if " + , Space + , Str "of" + , Space + , Str "money." + , Space + , Str "So" + , Space + , Str "is" + , Space + , Str "$34,000." + , Space + , Str "(It" + , Space + , Str "worked" + , Space + , Str "if" + , Space , Quoted DoubleQuote [ Str "lot" ] - , Str " is" + , Space + , Str "is" , SoftBreak , Str "emphasized.)" ] ] - , [ Plain [ Str "Shoes ($20) and socks ($5)." ] ] , [ Plain - [ Str "Escaped " + [ Str "Shoes" + , Space + , Str "($20)" + , Space + , Str "and" + , Space + , Str "socks" + , Space + , Str "($5)." + ] + ] + , [ Plain + [ Str "Escaped" + , Space , Code ( "" , [] , [] ) "$" - , Str ": $73 " - , Emph [ Str "this should be emphasized" ] - , Str " 23$." + , Str ":" + , Space + , Str "$73" + , Space + , Emph + [ Str "this" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "emphasized" + ] + , Space + , Str "23$." ] ] ] - , Para [ Str "Here\8217s a LaTeX table:" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "LaTeX" + , Space + , Str "table:" + ] , HorizontalRule ] , Div ( "special-characters" , [ "section" ] , [] ) - [ Header 1 ( "" , [] , [] ) [ Str "Special Characters" ] - , Para [ Str "Here is some unicode:" ] + [ Header + 1 + ( "" , [] , [] ) + [ Str "Special" , Space , Str "Characters" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "unicode:" + ] , BulletList - [ [ Plain [ Str "I hat: \206" ] ] - , [ Plain [ Str "o umlaut: \246" ] ] - , [ Plain [ Str "section: \167" ] ] - , [ Plain [ Str "set membership: \8712" ] ] - , [ Plain [ Str "copyright: \169" ] ] - ] - , Para [ Str "AT&T has an ampersand in their name." ] - , Para [ Str "AT&T is another way to write it." ] - , Para [ Str "This & that." ] - , Para [ Str "4 < 5." ] - , Para [ Str "6 > 5." ] - , Para [ Str "Backslash: \\" ] - , Para [ Str "Backtick: `" ] - , Para [ Str "Asterisk: *" ] - , Para [ Str "Underscore: _" ] - , Para [ Str "Left brace: {" ] - , Para [ Str "Right brace: }" ] - , Para [ Str "Left bracket: [" ] - , Para [ Str "Right bracket: ]" ] - , Para [ Str "Left paren: (" ] - , Para [ Str "Right paren: )" ] - , Para [ Str "Greater-than: >" ] - , Para [ Str "Hash: #" ] - , Para [ Str "Period: ." ] - , Para [ Str "Bang: !" ] - , Para [ Str "Plus: +" ] - , Para [ Str "Minus: -" ] + [ [ Plain + [ Str "I" , Space , Str "hat:" , Space , Str "\206" ] + ] + , [ Plain + [ Str "o" , Space , Str "umlaut:" , Space , Str "\246" ] + ] + , [ Plain [ Str "section:" , Space , Str "\167" ] ] + , [ Plain + [ Str "set" + , Space + , Str "membership:" + , Space + , Str "\8712" + ] + ] + , [ Plain [ Str "copyright:" , Space , Str "\169" ] ] + ] + , Para + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." + ] + , Para + [ Str "AT&T" + , Space + , Str "is" + , Space + , Str "another" + , Space + , Str "way" + , Space + , Str "to" + , Space + , Str "write" + , Space + , Str "it." + ] + , Para + [ Str "This" , Space , Str "&" , Space , Str "that." ] + , Para [ Str "4" , Space , Str "<" , Space , Str "5." ] + , Para [ Str "6" , Space , Str ">" , Space , Str "5." ] + , Para [ Str "Backslash:" , Space , Str "\\" ] + , Para [ Str "Backtick:" , Space , Str "`" ] + , Para [ Str "Asterisk:" , Space , Str "*" ] + , Para [ Str "Underscore:" , Space , Str "_" ] + , Para + [ Str "Left" , Space , Str "brace:" , Space , Str "{" ] + , Para + [ Str "Right" , Space , Str "brace:" , Space , Str "}" ] + , Para + [ Str "Left" , Space , Str "bracket:" , Space , Str "[" ] + , Para + [ Str "Right" , Space , Str "bracket:" , Space , Str "]" ] + , Para + [ Str "Left" , Space , Str "paren:" , Space , Str "(" ] + , Para + [ Str "Right" , Space , Str "paren:" , Space , Str ")" ] + , Para [ Str "Greater-than:" , Space , Str ">" ] + , Para [ Str "Hash:" , Space , Str "#" ] + , Para [ Str "Period:" , Space , Str "." ] + , Para [ Str "Bang:" , Space , Str "!" ] + , Para [ Str "Plus:" , Space , Str "+" ] + , Para [ Str "Minus:" , Space , Str "-" ] , HorizontalRule ] , Div @@ -708,14 +1663,22 @@ Pandoc ( "explicit" , [ "section" ] , [] ) [ Header 2 ( "" , [] , [] ) [ Str "Explicit" ] , Para - [ Str "Just a " + [ Str "Just" + , Space + , Str "a" + , Space , Link ( "" , [] , [] ) [ Str "URL" ] ( "/url/" , "" ) , Str "." ] , Para [ Link ( "" , [] , [ ( "title" , "title" ) ] ) - [ Str "URL and title" ] + [ Str "URL" + , Space + , Str "and" + , Space + , Str "title" + ] ( "/url/" , "" ) , Str "." ] @@ -725,7 +1688,12 @@ Pandoc , [] , [ ( "title" , "title preceded by two spaces" ) ] ) - [ Str "URL and title" ] + [ Str "URL" + , Space + , Str "and" + , Space + , Str "title" + ] ( "/url/" , "" ) , Str "." ] @@ -735,7 +1703,12 @@ Pandoc , [] , [ ( "title" , "title preceded by a tab" ) ] ) - [ Str "URL and title" ] + [ Str "URL" + , Space + , Str "and" + , Space + , Str "title" + ] ( "/url/" , "" ) , Str "." ] @@ -745,7 +1718,12 @@ Pandoc , [] , [ ( "title" , "title with \"quotes\" in it" ) ] ) - [ Str "URL and title" ] + [ Str "URL" + , Space + , Str "and" + , Space + , Str "title" + ] ( "/url/" , "" ) ] , Para @@ -754,7 +1732,12 @@ Pandoc , [] , [ ( "title" , "title with single quotes" ) ] ) - [ Str "URL and title" ] + [ Str "URL" + , Space + , Str "and" + , Space + , Str "title" + ] ( "/url/" , "" ) ] , Para @@ -766,7 +1749,7 @@ Pandoc , Para [ Link ( "" , [] , [] ) - [ Str "Email link" ] + [ Str "Email" , Space , Str "link" ] ( "mailto:nobody@nowhere.net" , "" ) ] , Para @@ -778,41 +1761,70 @@ Pandoc ( "reference" , [ "section" ] , [] ) [ Header 2 ( "" , [] , [] ) [ Str "Reference" ] , Para - [ Str "Foo " + [ Str "Foo" + , Space , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) , Str "." ] , Para - [ Str "With " + [ Str "With" + , Space , Link ( "" , [] , [] ) - [ Str "embedded [brackets]" ] + [ Str "embedded" , Space , Str "[brackets]" ] ( "/url/" , "" ) , Str "." ] , Para [ Link ( "" , [] , [] ) [ Str "b" ] ( "/url/" , "" ) - , Str " by itself should be a link." + , Space + , Str "by" + , Space + , Str "itself" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." ] , Para - [ Str "Indented " + [ Str "Indented" + , Space , Link ( "" , [] , [] ) [ Str "once" ] ( "/url" , "" ) , Str "." ] , Para - [ Str "Indented " + [ Str "Indented" + , Space , Link ( "" , [] , [] ) [ Str "twice" ] ( "/url" , "" ) , Str "." ] , Para - [ Str "Indented " + [ Str "Indented" + , Space , Link ( "" , [] , [] ) [ Str "thrice" ] ( "/url" , "" ) , Str "." ] - , Para [ Str "This should [not][] be a link." ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "[not][]" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] , CodeBlock ( "" , [ "" ] , [] ) "[not]: /url\n" , Para - [ Str "Foo " + [ Str "Foo" + , Space , Link ( "" , [] @@ -823,7 +1835,8 @@ Pandoc , Str "." ] , Para - [ Str "Foo " + [ Str "Foo" + , Space , Link ( "" , [] @@ -836,18 +1849,54 @@ Pandoc ] , Div ( "with-ampersands" , [ "section" ] , [] ) - [ Header 2 ( "" , [] , [] ) [ Str "With ampersands" ] + [ Header + 2 + ( "" , [] , [] ) + [ Str "With" , Space , Str "ampersands" ] , Para - [ Str "Here\8217s a " + [ Str "Here\8217s" + , Space + , Str "a" + , Space , Link ( "" , [] , [] ) - [ Str "link with an ampersand in the URL" ] + [ Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "URL" + ] ( "http://example.com/?foo=1&bar=2" , "" ) , Str "." ] , Para - [ Str - "Here\8217s a link with an amersand in the link text:" + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "amersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "link" + , Space + , Str "text:" , SoftBreak , Link ( "" , [] , [ ( "title" , "AT&T" ) ] ) @@ -856,18 +1905,33 @@ Pandoc , Str "." ] , Para - [ Str "Here\8217s an " + [ Str "Here\8217s" + , Space + , Str "an" + , Space , Link ( "" , [] , [] ) - [ Str "inline link" ] + [ Str "inline" , Space , Str "link" ] ( "/script?foo=1&bar=2" , "" ) , Str "." ] , Para - [ Str "Here\8217s an " + [ Str "Here\8217s" + , Space + , Str "an" + , Space , Link ( "" , [] , [] ) - [ Str "inline link in pointy braces" ] + [ Str "inline" + , Space + , Str "link" + , Space + , Str "in" + , Space + , Str "pointy" + , Space + , Str "braces" + ] ( "/script?foo=1&bar=2" , "" ) , Str "." ] @@ -876,14 +1940,21 @@ Pandoc ( "autolinks" , [ "section" ] , [] ) [ Header 2 ( "" , [] , [] ) [ Str "Autolinks" ] , Para - [ Str "With an ampersand: " + [ Str "With" + , Space + , Str "an" + , Space + , Str "ampersand:" + , Space , Link ( "" , [ "uri" ] , [] ) [ Str "http://example.com/?foo=1&bar=2" ] ( "http://example.com/?foo=1&bar=2" , "" ) ] , BulletList - [ [ Plain [ Str "In a list?" ] ] + [ [ Plain + [ Str "In" , Space , Str "a" , Space , Str "list?" ] + ] , [ Plain [ Link ( "" , [ "uri" ] , [] ) @@ -891,10 +1962,15 @@ Pandoc ( "http://example.com/" , "" ) ] ] - , [ Plain [ Str "It should." ] ] + , [ Plain [ Str "It" , Space , Str "should." ] ] ] , Para - [ Str "An e-mail address: " + [ Str "An" + , Space + , Str "e-mail" + , Space + , Str "address:" + , Space , Link ( "" , [ "email" ] , [] ) [ Str "nobody@nowhere.net" ] @@ -902,7 +1978,8 @@ Pandoc ] , BlockQuote [ Para - [ Str "Blockquoted: " + [ Str "Blockquoted:" + , Space , Link ( "" , [ "uri" ] , [] ) [ Str "http://example.com/" ] @@ -910,7 +1987,16 @@ Pandoc ] ] , Para - [ Str "Auto-links should not occur here: " + [ Str "Auto-links" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "occur" + , Space + , Str "here:" + , Space , Code ( "" , [] , [] ) "" ] , CodeBlock @@ -922,9 +2008,26 @@ Pandoc ( "images" , [ "section" ] , [] ) [ Header 1 ( "" , [] , [] ) [ Str "Images" ] , Para - [ Str "From " - , Quoted DoubleQuote [ Str "Voyage dans la Lune" ] - , Str " by Georges Melies (1902):" + [ Str "From" + , Space + , Quoted + DoubleQuote + [ Str "Voyage" + , Space + , Str "dans" + , Space + , Str "la" + , Space + , Str "Lune" + ] + , Space + , Str "by" + , Space + , Str "Georges" + , Space + , Str "Melies" + , Space + , Str "(1902):" ] , Div ( "" , [] , [] ) @@ -937,10 +2040,18 @@ Pandoc , Div ( "" , [ "caption" ] , [] ) [ Para [ Str "lalune" ] ] ] , Para - [ Str "Here is a movie " + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "movie" + , Space , Image ( "" , [] , [] ) [ Str "movie" ] ( "movie.jpg" , "" ) - , Str " icon." + , Space + , Str "icon." ] , HorizontalRule ] @@ -948,78 +2059,307 @@ Pandoc ( "footnotes" , [ "section" ] , [] ) [ Header 1 ( "" , [] , [] ) [ Str "Footnotes" ] , Para - [ Str "Here is a footnote reference," + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," , Note [ Para - [ Str - "Here is the footnote. It can go anywhere after the footnote reference. It" + [ 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" , SoftBreak - , Str "need not be placed at the end of the document." + , 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 " and another." + , Space + , Str "and" + , Space + , Str "another." , Note [ Para - [ Str - "Here\8217s the long note. This one contains multiple blocks." + [ Str "Here\8217s" + , 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 blocks are indented to show that they belong to the footnote (as" + [ 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" , SoftBreak - , Str "with list items)." + , Str "with" + , Space + , Str "list" + , Space + , Str "items)." ] , CodeBlock ( "" , [ "" ] , [] ) "{ }\n" , Para - [ Str - "If you want, you can indent every line, but you can also be lazy and just" + [ 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" , SoftBreak - , Str "indent the first line of each block." + , Str "indent" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "line" + , Space + , Str "of" + , Space + , Str "each" + , Space + , Str "block." ] ] - , Str " This should " + , Space + , Str "This" + , Space + , Str "should" + , Space , Emph [ Str "not" ] - , Str " be a" + , Space + , Str "be" + , Space + , Str "a" , SoftBreak - , Str - "footnote reference, because it contains a space.[^my note] Here is an inline" + , Str "footnote" + , Space + , Str "reference," + , Space + , Str "because" + , Space + , Str "it" + , Space + , Str "contains" + , Space + , Str "a" + , Space + , Str "space.[^my" + , Space + , Str "note]" + , Space + , Str "Here" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "inline" , SoftBreak , Str "note." , Note [ Para - [ Str "This is " + [ Str "This" + , Space + , Str "is" + , Space , Emph [ Str "easier" ] - , Str " to type. Inline notes may contain" + , Space + , Str "to" + , Space + , Str "type." + , Space + , Str "Inline" + , Space + , Str "notes" + , Space + , Str "may" + , Space + , Str "contain" , SoftBreak , Link ( "" , [] , [] ) [ Str "links" ] ( "http://google.com" , "" ) - , Str " and " + , Space + , Str "and" + , Space , Code ( "" , [] , [] ) "]" - , Str " verbatim characters, as well as" + , Space + , Str "verbatim" + , Space + , Str "characters," + , Space + , Str "as" + , Space + , Str "well" + , Space + , Str "as" , SoftBreak - , Str "[bracketed text]." + , Str "[bracketed" + , Space + , Str "text]." ] ] ] , BlockQuote [ Para - [ Str "Notes can go in quotes." - , Note [ Para [ Str "In quote." ] ] + [ Str "Notes" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "in" + , Space + , Str "quotes." + , Note [ Para [ Str "In" , Space , Str "quote." ] ] ] ] , OrderedList ( 1 , Decimal , Period ) [ [ Plain - [ Str "And in list items." - , Note [ Para [ Str "In list." ] ] + [ Str "And" + , Space + , Str "in" + , Space + , Str "list" + , Space + , Str "items." + , Note [ Para [ Str "In" , Space , Str "list." ] ] ] ] ] , Para - [ Str - "This paragraph should not be part of the note, as it is not indented." + [ Str "This" + , Space + , Str "paragraph" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "part" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "note," + , Space + , Str "as" + , Space + , Str "it" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "indented." ] ] ] -- cgit v1.2.3