git.iko.soy/typeable/pandoc
on master help sign in
punctuation handling, and more html-specific handling
c3866f3paul.rivier
src/Text/Pandoc/Readers/Markdown.hs+2−1
@@ -28,7 +28,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28Conversion of markdown-formatted plain text to 'Pandoc' document.
28Conversion of markdown-formatted plain text to 'Pandoc' document.
29-}
29-}
30module Text.Pandoc.Readers.Markdown (
30module Text.Pandoc.Readers.Markdown (
31− readMarkdown
31+ readMarkdown,
32+ smartPunctuation
32 ) where
33 ) where
33
34
34import Data.List ( transpose, isSuffixOf, sortBy, findIndex, intercalate )
35import Data.List ( transpose, isSuffixOf, sortBy, findIndex, intercalate )
src/Text/Pandoc/Readers/Textile.hs+31−7
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 Portability : portable
26 Portability : portable
27
27
28Conversion from Textile to 'Pandoc' document, based on the spec
28Conversion from Textile to 'Pandoc' document, based on the spec
29−available at ahttp://redcloth.org/hobix.com/textile/
29+available at http://redcloth.org/textile.
30
30
31Implemented and parsed:
31Implemented and parsed:
32 - Paragraphs
32 - Paragraphs
@@ -34,7 +34,7 @@ Implemented and parsed:
34 - Lists
34 - Lists
35 - blockquote
35 - blockquote
36 - Inlines : strong, emph, cite, code, deleted, superscript,
36 - Inlines : strong, emph, cite, code, deleted, superscript,
37− subscript, links
37+ subscript, links, smart punctuation
38
38
39Implemented but discarded:
39Implemented but discarded:
40 - HTML-specific and CSS-specific attributes
40 - HTML-specific and CSS-specific attributes
@@ -42,7 +42,20 @@ Implemented but discarded:
42Left to be implemented:
42Left to be implemented:
43 - Pandoc Meta Information (title, author, date)
43 - Pandoc Meta Information (title, author, date)
44 - footnotes
44 - footnotes
45− - should autolink be shared through Parsing.hs ?
45+ - dimension sign
46+ - registered, trademark, and copyright symbols
47+ - acronyms
48+ - uppercase
49+ - definition lists
50+ - continued blocks (ex bq..)
51+ -
52+
53+
54+
55+TODO : refactor common patterns across readers :
56+ - autolink
57+ - smartPunctuation
58+ - more ...
46
59
47-}
60-}
48
61
@@ -55,6 +68,7 @@ import Text.Pandoc.Shared
55import Text.Pandoc.Parsing
68import Text.Pandoc.Parsing
56import Text.Pandoc.Readers.HTML ( htmlTag, htmlEndTag, -- find code blocks
69import Text.Pandoc.Readers.HTML ( htmlTag, htmlEndTag, -- find code blocks
57 rawHtmlBlock, rawHtmlInline )
70 rawHtmlBlock, rawHtmlInline )
71+import Text.Pandoc.Readers.Markdown (smartPunctuation)
58import Text.ParserCombinators.Parsec
72import Text.ParserCombinators.Parsec
59import Data.Char ( digitToInt )
73import Data.Char ( digitToInt )
60
74
@@ -71,7 +85,7 @@ readTextile state s = (readWith parseTextile) state (s ++ "\n\n")
71
85
72-- | Special chars border strings parsing
86-- | Special chars border strings parsing
73specialChars :: [Char]
87specialChars :: [Char]
74−specialChars = "\\[]*#_@~<>!?-+^&'\";:|"
88+specialChars = "\\[]<>*#_@~-+^&,.;:!?|\"'%"
75
89
76-- | Generate a Pandoc ADT from a textile document
90-- | Generate a Pandoc ADT from a textile document
77parseTextile :: GenParser Char ParserState Pandoc
91parseTextile :: GenParser Char ParserState Pandoc
@@ -275,6 +289,8 @@ inlines = manyTill inline newline
275inlineParsers :: [GenParser Char ParserState Inline]
289inlineParsers :: [GenParser Char ParserState Inline]
276inlineParsers = [ autoLink
290inlineParsers = [ autoLink
277 , str
291 , str
292+ , htmlSpan
293+ , smartPunctuation -- from markdown reader
278 , whitespace
294 , whitespace
279 , endline
295 , endline
280 , rawHtmlInline
296 , rawHtmlInline
@@ -296,17 +312,25 @@ inlineParsers = [ autoLink
296str :: GenParser Char ParserState Inline
312str :: GenParser Char ParserState Inline
297str = many1 (noneOf (specialChars ++ "\t\n ")) >>= return . Str
313str = many1 (noneOf (specialChars ++ "\t\n ")) >>= return . Str
298
314
315+-- | Textile allows HTML span infos, we discard them
316+htmlSpan :: GenParser Char ParserState Inline
317+htmlSpan = try $ do
318+ char '%'
319+ _ <- attributes
320+ content <- manyTill anyChar (char '%')
321+ return $ Str content
322+
299-- | Some number of space chars
323-- | Some number of space chars
300whitespace :: GenParser Char ParserState Inline
324whitespace :: GenParser Char ParserState Inline
301whitespace = many1 spaceChar >> return Space <?> "whitespace"
325whitespace = many1 spaceChar >> return Space <?> "whitespace"
302
326
303−-- | In Textile, an endline character that can be treated as a space,
327+-- | In Textile, an isolated endline character is a line break
304−-- not a structural break
305endline :: GenParser Char ParserState Inline
328endline :: GenParser Char ParserState Inline
306endline = try $ do
329endline = try $ do
307 newline >> notFollowedBy blankline
330 newline >> notFollowedBy blankline
308− return Space
331+ return LineBreak
309
332
333+-- | Textile standard link syntax is label:"target"
310link :: GenParser Char ParserState Inline
334link :: GenParser Char ParserState Inline
311link = try $ do
335link = try $ do
312 name <- surrounded (char '"') inline
336 name <- surrounded (char '"') inline
tests/textile-reader.native+33−35
@@ -1,5 +1,5 @@
1Pandoc (Meta {docTitle = [Str ""], docAuthors = [[Str ""]], docDate = [Str ""]})
1Pandoc (Meta {docTitle = [Str ""], docAuthors = [[Str ""]], docDate = [Str ""]})
2−[ 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",Str "'",Str "s",Space,Str "markdown",Space,Str "test",Space,Str "suite."]
2+[ 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 "Textile",Space,Str "Reader",Str ".",Space,Str "Part",Space,Str "of",Space,Str "it",Space,Str "comes",LineBreak,Str "from",Space,Str "John",Space,Str "Gruber",Str "'",Str "s",Space,Str "markdown",Space,Str "test",Space,Str "suite",Str "."]
3, Para [Strikeout [Str "-"],Str "-",Str "-"]
3, Para [Strikeout [Str "-"],Str "-",Str "-"]
4, Header 1 [Str "Headers"]
4, Header 1 [Str "Headers"]
5, Header 2 [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",Space,Link [Str "embeded",Space,Str "link"] ("http://www.example.com","")]
5, Header 2 [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",Space,Link [Str "embeded",Space,Str "link"] ("http://www.example.com","")]
@@ -8,19 +8,19 @@ Pandoc (Meta {docTitle = [Str ""], docAuthors = [[Str ""]], docDate = [Str ""]})
8, Header 5 [Str "Level",Space,Str "5"]
8, Header 5 [Str "Level",Space,Str "5"]
9, Header 6 [Str "Level",Space,Str "6"]
9, Header 6 [Str "Level",Space,Str "6"]
10, Header 1 [Str "Paragraphs"]
10, Header 1 [Str "Paragraphs"]
11−, Para [Str "Here",Str "'",Str "s",Space,Str "a",Space,Str "regular",Space,Str "paragraph."]
11+, Para [Str "Here",Str "'",Str "s",Space,Str "a",Space,Str "regular",Space,Str "paragraph",Str "."]
12−, Para [Str "Line",Space,Str "break",Space,Str "are",Space,Str "not",Space,Str "paragraph",Space,Str "break",Space,Str "in",Space,Str "textile,",Space,Str "so",Space,Str "you",Space,Str "can",Space,Str "wrap",Space,Str "your",Space,Str "very",Space,Str "long",Space,Str "paragraph",Space,Str "with",Space,Str "your",Space,Str "favourite",Space,Str "text",Space,Str "editor,",Space,Str "it",Space,Str "will",Space,Str "be",Space,Str "rendered",Space,Str "as",Space,Str "a",Space,Str "single",Space,Str "one."]
12+, Para [Str "Line",Space,Str "breaks",Space,Str "are",Space,Str "preserved",Space,Str "in",Space,Str "textile",Str ",",Space,Str "so",Space,Str "you",Space,Str "can",Space,Str "not",Space,Str "wrap",Space,Str "your",Space,Str "very",LineBreak,Str "long",Space,Str "paragraph",Space,Str "with",Space,Str "your",Space,Str "favourite",Space,Str "text",Space,Str "editor",Space,Str "and",Space,Str "have",Space,Str "it",Space,Str "rendered",LineBreak,Str "with",Space,Str "no",Space,Str "break",Str "."]
13−, Para [Str "Here",Str "'",Str "s",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "bullet."]
13+, Para [Str "Here",Str "'",Str "s",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "bullet",Str "."]
14, BulletList
14, BulletList
15− [ [ Plain [Str "criminey."] ]
15+ [ [ Plain [Str "criminey",Str "."] ]
16 ]
16 ]
17−, Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "hard",Space,Str "line",Space,Str "break"]
17+, Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "paragraph",Space,Str "break",Space,Str "between",Space,Str "here"]
18−, Para [Str "here."]
18+, Para [Str "and",Space,Str "here",Str "."]
19, Header 1 [Str "Block",Space,Str "Quotes"]
19, Header 1 [Str "Block",Space,Str "Quotes"]
20, BlockQuote
20, BlockQuote
21− [ Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "famous",Space,Str "quote",Space,Str "from",Space,Str "somebody.",Space,Str "He",Space,Str "had",Space,Str "a",Space,Str "lot",Space,Str "of",Space,Str "things",Space,Str "to",Space,Str "say,",Space,Str "so",Space,Str "the",Space,Str "text",Space,Str "is",Space,Str "really",Space,Str "really",Space,Str "long",Space,Str "and",Space,Str "spans",Space,Str "on",Space,Str "multiple",Space,Str "lines."] ]
21+ [ Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "famous",Space,Str "quote",Space,Str "from",Space,Str "somebody",Str ".",Space,Str "He",Space,Str "had",Space,Str "a",Space,Str "lot",Space,Str "of",Space,Str "things",Space,Str "to",LineBreak,Str "say",Str ",",Space,Str "so",Space,Str "the",Space,Str "text",Space,Str "is",Space,Str "really",Space,Str "really",Space,Str "long",Space,Str "and",Space,Str "spans",Space,Str "on",Space,Str "multiple",Space,Str "lines",Str "."] ]
22
22
23−, Para [Str "And",Space,Str "a",Space,Str "following",Space,Str "paragraph."]
23+, Para [Str "And",Space,Str "a",Space,Str "following",Space,Str "paragraph",Str "."]
24, Header 1 [Str "Code",Space,Str "Blocks"]
24, Header 1 [Str "Code",Space,Str "Blocks"]
25, Para [Str "Code",Str ":"]
25, Para [Str "Code",Str ":"]
26, CodeBlock ("",[],[]) "\n ---- (should be four hyphens)\n\n sub status {\n print \"working\";\n }\n\n this code block is indented by one tab\n"
26, CodeBlock ("",[],[]) "\n ---- (should be four hyphens)\n\n sub status {\n print \"working\";\n }\n\n this code block is indented by one tab\n"
@@ -43,24 +43,22 @@ Pandoc (Meta {docTitle = [Str ""], docAuthors = [[Str ""]], docDate = [Str ""]})
43, BulletList
43, BulletList
44 [ [ Plain [Str "ui",Space,Str "1"]
44 [ [ Plain [Str "ui",Space,Str "1"]
45 , BulletList
45 , BulletList
46− [ [ Plain [Str "ui",Space,Str "1.1"]
46+ [ [ Plain [Str "ui",Space,Str "1",Str ".",Str "1"]
47 , OrderedList (1,DefaultStyle,DefaultDelim)
47 , OrderedList (1,DefaultStyle,DefaultDelim)
48− [ [ Plain [Str "oi",Space,Str "1.1.1"] ]
48+ [ [ Plain [Str "oi",Space,Str "1",Str ".",Str "1",Str ".",Str "1"] ]
49− , [ Plain [Str "oi",Space,Str "1.1.2"] ] ] ], [ Plain [Str "ui",Space,Str "1.2"] ] ] ], [ Plain [Str "ui",Space,Str "2"]
49+ , [ Plain [Str "oi",Space,Str "1",Str ".",Str "1",Str ".",Str "2"] ] ] ], [ Plain [Str "ui",Space,Str "1",Str ".",Str "2"] ] ] ], [ Plain [Str "ui",Space,Str "2"]
50 , OrderedList (1,DefaultStyle,DefaultDelim)
50 , OrderedList (1,DefaultStyle,DefaultDelim)
51− [ [ Plain [Str "oi",Space,Str "2.1"]
51+ [ [ Plain [Str "oi",Space,Str "2",Str ".",Str "1"]
52 , BulletList
52 , BulletList
53− [ [ Plain [Str "ui",Space,Str "2.1.1"] ]
53+ [ [ Plain [Str "ui",Space,Str "2",Str ".",Str "1",Str ".",Str "1"] ]
54− , [ Plain [Str "ui",Space,Str "2.1.2"] ] ] ] ] ] ]
54+ , [ Plain [Str "ui",Space,Str "2",Str ".",Str "1",Str ".",Str "2"] ] ] ] ] ] ]
55, Header 1 [Str "Inline",Space,Str "Markup"]
55, Header 1 [Str "Inline",Space,Str "Markup"]
56−, Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str "."]
56+, Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str ".",LineBreak,Str "This",Space,Str "is",Space,Strong [Str "strong"],Str ",",Space,Str "and",Space,Str "so",Space,Strong [Str "is",Space,Str "this"],Str ".",LineBreak,Str "A",Space,Link [Strong [Str "strong",Space,Str "link"]] ("http://www.foobar.com",""),Str "."]
57−, Para [Str "This",Space,Str "is",Space,Strong [Str "strong"],Str ",",Space,Str "and",Space,Str "so",Space,Strong [Str "is",Space,Str "this"],Str "."]
58−, Para [Str "A",Space,Link [Strong [Str "strong",Space,Str "link"]] ("http://www.foobar.com",""),Str "."]
59−, Para [Emph [Strong [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]]
60−, Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Space,Str "and",Space,Emph [Strong [Str "that",Space,Str "one"]],Str "."]
57+, Para [Emph [Strong [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em",Str "."]],LineBreak,Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Space,Str "and",Space,Emph [Strong [Str "that",Space,Str "one"]],Str ".",LineBreak,Strikeout [Str "This",Space,Str "is",Space,Str "strikeout",Space,Str "and",Space,Strong [Str "strong"]]]
61−, Para [Strikeout [Str "This",Space,Str "is",Space,Str "strikeout",Space,Str "and",Space,Strong [Str "strong"]]]
62−, Para [Str "Superscripts",Str ":",Space,Str "a",Superscript [Str "bc"],Str "d",Space,Str "a",Superscript [Strong [Str "hello"]],Space,Str "a",Superscript [Str "hello",Space,Str "there"],Str "."]
58+, Para [Str "Superscripts",Str ":",Space,Str "a",Superscript [Str "bc"],Str "d",Space,Str "a",Superscript [Strong [Str "hello"]],Space,Str "a",Superscript [Str "hello",Space,Str "there"],Str ".",LineBreak,Str "Subscripts",Str ":",Space,Str "H",Subscript [Str "2"],Str "O",Str ",",Space,Str "H",Subscript [Str "23"],Str "O",Str ",",Space,Str "H",Subscript [Str "many",Space,Str "of",Space,Str "them"],Str "O",Str "."]
63−, Para [Str "Subscripts",Str ":",Space,Str "H",Subscript [Str "2"],Str "O,",Space,Str "H",Subscript [Str "23"],Str "O,",Space,Str "H",Subscript [Str "many",Space,Str "of",Space,Str "them"],Str "O."]
59+, Para [Str "Dashes",Space,Str ":",Space,Str "How",Space,Str "cool",Space,Str "-",Str "-",Space,Str "automatic",Space,Str "dashes",Str "."]
60+, Para [Str "Elipses",Space,Str ":",Space,Str "He",Space,Str "thought",Space,Str "and",Space,Str "thought",Space,Str ".",Str ".",Str ".",Space,Str "and",Space,Str "then",Space,Str "thought",Space,Str "some",Space,Str "more",Str "."]
61+, Para [Str "Quotes",Space,Str "and",Space,Str "apostrophes",Space,Str ":",Space,Str "\"",Str "I",Str "'",Str "d",Space,Str "like",Space,Str "to",Space,Str "thank",Space,Str "you",Str "\"",Space,Str "for",Space,Str "example",Str "."]
64, Header 1 [Str "Links"]
62, Header 1 [Str "Links"]
65, Header 2 [Str "Explicit"]
63, Header 2 [Str "Explicit"]
66, Para [Str "Just",Space,Str "a",Space,Link [Str "url"] ("http://www.url.com","")]
64, Para [Str "Just",Space,Str "a",Space,Link [Str "url"] ("http://www.url.com","")]
@@ -84,7 +82,7 @@ Pandoc (Meta {docTitle = [Str ""], docAuthors = [[Str ""]], docDate = [Str ""]})
84 [ [ Plain [Str "bella"] ]
82 [ [ Plain [Str "bella"] ]
85 , [ Plain [Str "45"] ]
83 , [ Plain [Str "45"] ]
86 , [ Plain [Str "f"] ] ] ]
84 , [ Plain [Str "f"] ] ] ]
87−, Para [Str "and",Space,Str "some",Space,Str "text",Space,Str "following",Space,Str "..."]
85+, Para [Str "and",Space,Str "some",Space,Str "text",Space,Str "following",Space,Str ".",Str ".",Str "."]
88, Header 2 [Str "With",Space,Str "headers"]
86, Header 2 [Str "With",Space,Str "headers"]
89, Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]
87, Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]
90 [ [ Plain [Str "name"] ]
88 [ [ Plain [Str "name"] ]
@@ -100,11 +98,11 @@ Pandoc (Meta {docTitle = [Str ""], docAuthors = [[Str ""]], docDate = [Str ""]})
100 , [ Plain [Str "45"] ]
98 , [ Plain [Str "45"] ]
101 , [ Plain [Str "f"] ] ] ]
99 , [ Plain [Str "f"] ] ] ]
102, Header 1 [Str "Images"]
100, Header 1 [Str "Images"]
103−, Para [Str "Textile",Space,Str "inline",Space,Str "image",Space,Str "syntax,",Space,Str "like",Space,Str "here",Space,Image [Str "this is the alt text"] ("this_is_an_image.png","this is the alt text"),Space,Str "and",Space,Str "here",Space,Image [Str ""] ("this_is_an_image.png",""),Str "."]
101+, Para [Str "Textile",Space,Str "inline",Space,Str "image",Space,Str "syntax",Str ",",Space,Str "like",Space,LineBreak,Str "here",Space,Image [Str "this is the alt text"] ("this_is_an_image.png","this is the alt text"),LineBreak,Str "and",Space,Str "here",Space,Image [Str ""] ("this_is_an_image.png",""),Str "."]
104, Header 1 [Str "Attributes"]
102, Header 1 [Str "Attributes"]
105, Header 2 [Str "HTML",Space,Str "and",Space,Str "CSS",Space,Str "attributes",Space,Str "are",Space,Str "ignored"]
103, Header 2 [Str "HTML",Space,Str "and",Space,Str "CSS",Space,Str "attributes",Space,Str "are",Space,Str "ignored"]
106−, Para [Str "as",Space,Str "well",Space,Str "as",Space,Strong [Str "inline",Space,Str "attributes"]]
104+, Para [Str "as",Space,Str "well",Space,Str "as",Space,Strong [Str "inline",Space,Str "attributes"],Space,Str "of",Space,Str " all kind"]
107−, Para [Str "and",Space,Str "paragraph",Space,Str "attributes,",Space,Str "and",Space,Str "table",Space,Str "attributes."]
105+, Para [Str "and",Space,Str "paragraph",Space,Str "attributes",Str ",",Space,Str "and",Space,Str "table",Space,Str "attributes",Str "."]
108, Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]
106, Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]
109 [
107 [
110 ] [
108 ] [
@@ -115,16 +113,16 @@ Pandoc (Meta {docTitle = [Str ""], docAuthors = [[Str ""]], docDate = [Str ""]})
115 , [ Plain [Str "24"] ]
113 , [ Plain [Str "24"] ]
116 , [ Plain [Str "f"] ] ] ]
114 , [ Plain [Str "f"] ] ] ]
117, Header 1 [Str "Raw",Space,Str "HTML"]
115, Header 1 [Str "Raw",Space,Str "HTML"]
118−, Para [Str "However,",Space,HtmlInline "<strong>",Space,Str "raw",Space,Str "HTML",Space,Str "inlines",Space,HtmlInline "</strong>",Space,Str "are",Space,Str "accepted,",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str ":"]
116+, Para [Str "However",Str ",",Space,Str "raw",Space,Str "HTML",Space,Str "inlines",Space,Str "are",Space,Str "accepted",Str ",",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str ":"]
119−, RawHtml "<div class=\"foobar\">"
117+, Null
120−, Para [Str "any",Space,Strong [Str "Raw",Space,Str "HTML",Space,Str "Block"],Space,Str "with",Space,Str "bold"]
118+, Para [Str "any",Space,Strong [Str "Raw",Space,Str "HTML",Space,Str "Block"],Space,Str "with",Space,Str "bold",LineBreak]
121−, RawHtml "</div>"
119+, Null
122, Para [Str "Html",Space,Str "blocks",Space,Str "can",Space,Str "be"]
120, Para [Str "Html",Space,Str "blocks",Space,Str "can",Space,Str "be"]
123−, RawHtml "<div>"
121+, Null
124, Para [Str "inlined"]
122, Para [Str "inlined"]
125−, RawHtml "</div>"
123+, Null
126−, Para [Str "as",Space,Str "well."]
124+, Para [Str "as",Space,Str "well",Str "."]
127, BulletList
125, BulletList
128 [ [ Plain [Str "this",Space,Str "<",Str "div",Str ">",Space,Str "won",Str "'",Str "t",Space,Str "produce",Space,Str "raw",Space,Str "html",Space,Str "blocks",Space,Str "<",Str "/div",Str ">"] ]
126 [ [ Plain [Str "this",Space,Str "<",Str "div",Str ">",Space,Str "won",Str "'",Str "t",Space,Str "produce",Space,Str "raw",Space,Str "html",Space,Str "blocks",Space,Str "<",Str "/div",Str ">"] ]
129− , [ Plain [Str "but",Space,Str "this",Space,HtmlInline "<strong>",Space,Str "will",Space,Str "produce",Space,Str "inline",Space,Str "html",Space,HtmlInline "</strong>"] ] ]
127+ , [ Plain [Str "but",Space,Str "this",Space,Str "",Space,Str "will",Space,Str "produce",Space,Str "inline",Space,Str "html",Space,Str ""] ] ]
130, Para [Str "Can",Space,Str "you",Space,Str "prove",Space,Str "that",Space,Str "2",Space,Str "<",Space,Str "3",Space,Str "?"] ]
128, Para [Str "Can",Space,Str "you",Space,Str "prove",Space,Str "that",Space,Str "2",Space,Str "<",Space,Str "3",Space,Str "?"] ]
tests/textile-reader.textile+15−13
@@ -1,5 +1,5 @@
1−This is a set of tests for pandoc. Most of them are adapted from John
1+This is a set of tests for pandoc Textile Reader. Part of it comes
2−Gruber's markdown test suite.
2+from John Gruber's markdown test suite.
3
3
4-----
4-----
5
5
@@ -20,17 +20,18 @@ h1. Paragraphs
20
20
21Here's a regular paragraph.
21Here's a regular paragraph.
22
22
23−Line break are not paragraph break in textile, so you can wrap your
23+Line breaks are preserved in textile, so you can not wrap your very
24−very long paragraph with your favourite text editor, it will be
24+long paragraph with your favourite text editor and have it rendered
25−rendered as a single one.
25+with no break.
26+
26
27
27Here's one with a bullet.
28Here's one with a bullet.
28
29
29* criminey.
30* criminey.
30
31
31−There should be a hard line break
32+There should be a paragraph break between here
32
33
33−here.
34+and here.
34
35
35h1. Block Quotes
36h1. Block Quotes
36
37
@@ -96,21 +97,22 @@ h2. Nested
96h1. Inline Markup
97h1. Inline Markup
97
98
98This is _emphasized_, and so __is this__.
99This is _emphasized_, and so __is this__.
99−
100This is *strong*, and so **is this**.
100This is *strong*, and so **is this**.
101−
102A "*strong link*":http://www.foobar.com.
101A "*strong link*":http://www.foobar.com.
103
102
104_*This is strong and em.*_
103_*This is strong and em.*_
105−
106So is *_this_* word and __**that one**__.
104So is *_this_* word and __**that one**__.
107−
108-This is strikeout and *strong*-
105-This is strikeout and *strong*-
109
106
110Superscripts: a^bc^d a^*hello*^ a^hello there^.
107Superscripts: a^bc^d a^*hello*^ a^hello there^.
111−
112Subscripts: H~2~O, H~23~O, H~many of them~O.
108Subscripts: H~2~O, H~23~O, H~many of them~O.
113
109
110+Dashes : How cool -- automatic dashes.
111+
112+Elipses : He thought and thought ... and then thought some more.
113+
114+Quotes and apostrophes : "I'd like to thank you" for example.
115+
114
116
115h1. Links
117h1. Links
116
118
@@ -154,7 +156,7 @@ h1. Attributes
154
156
155h2{color:red}. HTML and CSS attributes are ignored
157h2{color:red}. HTML and CSS attributes are ignored
156
158
157−as well as *(foo)inline attributes*
159+as well as *(foo)inline attributes* of %{color:red} all kind%
158
160
159p{color:green}. and paragraph attributes, and table attributes.
161p{color:green}. and paragraph attributes, and table attributes.
160
162