git.iko.soy/typeable/pandoc
on master help sign in
Removed Blank block element as unnecessary.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@578 788f1e2b-df1e-0410-8736-df70ead52e1b

commit571c3b41737f3a331706833adeb8241d93cef10c authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 17 Mar 2007, 20:23 (20 years ago) parent9b3d5d8
12 files changed+6−20
src/Text/Pandoc/Definition.hs−1 src/Text/Pandoc/Readers/Markdown.hs+1−1 src/Text/Pandoc/Readers/RST.hs+1−1 src/Text/Pandoc/Shared.hs−1 src/Text/Pandoc/Writers/Docbook.hs−1 src/Text/Pandoc/Writers/HTML.hs−1 src/Text/Pandoc/Writers/LaTeX.hs−1 src/Text/Pandoc/Writers/Markdown.hs+2−3 src/Text/Pandoc/Writers/RST.hs−1 src/Text/Pandoc/Writers/RTF.hs−1 src/Text/ParserCombinators/Pandoc.hs−7 tests/rst-reader.native+2−1
src/Text/Pandoc/Definition.hs−1
@@ -48,7 +48,6 @@ data Alignment = AlignLeft
4848-- | Block element.
4949data Block
5050 = Plain [Inline] -- ^ Plain text, not a paragraph
51− | Blank -- ^ A blank line
5251 | Null -- ^ Nothing
5352 | Para [Inline] -- ^ Paragraph
5453 | Key [Inline] Target -- ^ Reference key: name (inlines) and 'Target'
src/Text/Pandoc/Readers/Markdown.hs+1−1
@@ -191,7 +191,7 @@ parseBlocks = manyTill block eof
191191
192192block = choice [ header, table, codeBlock, note, referenceKey, hrule, list,
193193 blockQuote, htmlBlock, rawLaTeXEnvironment', para,
194− plain, blankBlock, nullBlock ] <?> "block"
194+ plain, nullBlock ] <?> "block"
195195
196196--
197197-- header blocks
src/Text/Pandoc/Readers/RST.hs+1−1
@@ -126,7 +126,7 @@ parseBlocks = manyTill block eof
126126block = choice [ codeBlock, rawHtmlBlock, rawLaTeXBlock, blockQuote,
127127 referenceKey, imageBlock, unknownDirective, header,
128128 hrule, list, fieldList, lineBlock, para, plain,
129− blankBlock, nullBlock ] <?> "block"
129+ nullBlock ] <?> "block"
130130
131131--
132132-- field list
src/Text/Pandoc/Shared.hs−1
@@ -432,7 +432,6 @@ keyTable [] = ([],[])
432432keyTable ((Key ref target):lst) = (((ref, target):table), rest)
433433 where (table, rest) = keyTable lst
434434keyTable (Null:lst) = keyTable lst -- get rid of Nulls
435−keyTable (Blank:lst) = keyTable lst -- get rid of Blanks
436435keyTable (other:lst) = (table, (other:rest))
437436 where (table, rest) = keyTable lst
438437
src/Text/Pandoc/Writers/Docbook.hs−1
@@ -133,7 +133,6 @@ listItemToDocbook opts item =
133133
134134-- | Convert a Pandoc block element to Docbook.
135135blockToDocbook :: WriterOptions -> Block -> Doc
136−blockToDocbook opts Blank = text ""
137136blockToDocbook opts Null = empty
138137blockToDocbook opts (Plain lst) = wrap opts lst
139138blockToDocbook opts (Para lst) =
src/Text/Pandoc/Writers/HTML.hs−1
@@ -131,7 +131,6 @@ obfuscateString = concatMap obfuscateChar
131131
132132-- | Convert Pandoc block element to HTML.
133133blockToHtml :: WriterOptions -> Block -> Html
134−blockToHtml opts Blank = noHtml
135134blockToHtml opts Null = noHtml
136135blockToHtml opts (Plain lst) = inlineListToHtml opts lst
137136blockToHtml opts (Para lst) = paragraph $ inlineListToHtml opts lst
src/Text/Pandoc/Writers/LaTeX.hs−1
@@ -102,7 +102,6 @@ deVerb (other:rest) = other:(deVerb rest)
102102blockToLaTeX :: [Block] -- ^ List of note blocks to use in resolving note refs
103103 -> Block -- ^ Block to convert
104104 -> String
105−blockToLaTeX notes Blank = "\n"
106105blockToLaTeX notes Null = ""
107106blockToLaTeX notes (Plain lst) = inlineListToLaTeX notes lst ++ "\n"
108107blockToLaTeX notes (Para lst) = (inlineListToLaTeX notes lst) ++ "\n\n"
src/Text/Pandoc/Writers/Markdown.hs+2−3
@@ -75,8 +75,8 @@ formatKeys [] = []
7575formatKeys [x] = [x]
7676formatKeys ((Key x1 y1):(Key x2 y2):rest) =
7777 (Key x1 y1):(formatKeys ((Key x2 y2):rest))
78−formatKeys ((Key x1 y1):rest) = (Key x1 y1):Blank:(formatKeys rest)
79−formatKeys (x:(Key x1 y1):rest) = x:Blank:(formatKeys ((Key x1 y1):rest))
78+formatKeys ((Key x1 y1):rest) = (Key x1 y1):(Plain [Str ""]):(formatKeys rest)
79+formatKeys (x:(Key x1 y1):rest) = x:(Plain [Str ""]):(formatKeys ((Key x1 y1):rest))
8080formatKeys (x:rest) = x:(formatKeys rest)
8181
8282-- | Convert bibliographic information into Markdown header.
@@ -103,7 +103,6 @@ dateToMarkdown str = text "% " <> text (escapeString str)
103103blockToMarkdown :: Int -- ^ Tab stop
104104 -> Block -- ^ Block element
105105 -> Doc
106−blockToMarkdown tabStop Blank = text ""
107106blockToMarkdown tabStop Null = empty
108107blockToMarkdown tabStop (Plain lst) = wrappedMarkdown lst
109108blockToMarkdown tabStop (Para lst) = (wrappedMarkdown lst) <> (text "\n")
src/Text/Pandoc/Writers/RST.hs−1
@@ -112,7 +112,6 @@ dateToRST str = text ":Date: " <> text (escapeString str) <> char '\n'
112112blockToRST :: Int -- ^ tab stop
113113 -> Block -- ^ block element to convert
114114 -> (Doc, Doc) -- ^ first element is text, second is references for end of file
115−blockToRST tabStop Blank = (text "\n", empty)
116115blockToRST tabStop Null = (empty, empty)
117116blockToRST tabStop (Plain lst) = wrappedRST lst
118117blockToRST tabStop (Para [TeX str]) = -- raw latex block
src/Text/Pandoc/Writers/RTF.hs−1
@@ -146,7 +146,6 @@ blockToRTF :: [Block] -- ^ list of note blocks
146146 -> Int -- ^ indent level
147147 -> Block -- ^ block to convert
148148 -> String
149−blockToRTF notes indent Blank = rtfPar indent 0 ""
150149blockToRTF notes indent Null = ""
151150blockToRTF notes indent (Plain lst) =
152151 rtfCompact indent 0 (inlineListToRTF notes lst)
src/Text/ParserCombinators/Pandoc.hs−7
@@ -38,7 +38,6 @@ module Text.ParserCombinators.Pandoc (
3838 blanklines,
3939 escaped,
4040 enclosed,
41− blankBlock,
4241 nullBlock,
4342 stringAnyCase,
4443 parseFromStr
@@ -59,12 +58,6 @@ nullBlock = do
5958 anyChar
6059 return Null
6160
62−-- | Parses one or more blank lines; returns 'Blank'.
63−blankBlock :: GenParser Char st Block
64−blankBlock = do
65− blanklines
66− return Blank
67−
6861-- | Parses a space or tab.
6962spaceChar :: CharParser st Char
7063spaceChar = oneOf " \t"
tests/rst-reader.native+2−1
@@ -172,4 +172,5 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite",Str ":",Space,Str
172172, Plain [Image [Str "image"] (Src "lalune.jpg" "")]
173173, Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "movie",Space,Image [Str "movie"] (Ref [Str "movie"]),Space,Str "icon."]
174174, Key [Str "movie"] (Src "movie.jpg" "")
175−, Blank ]
175+, Null
176+, Plain [] ]