git.iko.soy/typeable/pandoc
on master help sign in
Disallow blank lines in inline code span.

Also added additional test cases for markdown code spans. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1860 788f1e2b-df1e-0410-8736-df70ead52e1b

commit76e6c071d09cfcba8d8c2097756e581157d43820 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 6 Mar 2010, 02:42 (17 years ago) parentf5e00c5
3 files changed+21−2
src/Text/Pandoc/Readers/Markdown.hs+1−1 tests/markdown-reader-more.native+7−1 tests/markdown-reader-more.txt+13
src/Text/Pandoc/Readers/Markdown.hs+1−1
@@ -957,7 +957,7 @@ code = try $ do
957957 starts <- many1 (char '`')
958958 skipSpaces
959959 result <- many1Till (many1 (noneOf "`\n") <|> many1 (char '`') <|>
960− (char '\n' >> return " "))
960+ (char '\n' >> notFollowedBy' blankline >> return " "))
961961 (try (skipSpaces >> count (length starts) (char '`') >>
962962 notFollowedBy (char '`')))
963963 return $ Code $ removeLeadingTrailingSpace $ concat result
tests/markdown-reader-more.native+7−1
@@ -21,5 +21,11 @@ Pandoc (Meta {docTitle = [Str "Title",Space,Str "spanning",Space,Str "multiple",
2121 [ [ Plain [Str "one"]
2222 , RawHtml "<!--\n- two\n-->" ], [ Plain [Str "three"] ] ]
2323, Header 2 [Str "Backslash",Space,Str "newline"]
24−, Para [Str "hi",LineBreak,Str "there"] ]
24+, Para [Str "hi",LineBreak,Str "there"]
25+, Header 2 [Str "Code",Space,Str "spans"]
26+, Para [Code "hi\\"]
27+, Para [Code "hi there"]
28+, Para [Code "hi````there"]
29+, Para [Str "`",Str "hi"]
30+, Para [Str "there",Str "`"] ]
2531
tests/markdown-reader-more.txt+13
@@ -70,3 +70,16 @@ $\$2 + \$3$
7070hi\
7171there
7272
73+## Code spans
74+
75+`hi\`
76+
77+`hi
78+there`
79+
80+`` hi````there ``
81+
82+`hi
83+
84+there`
85+