diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2006-11-26 07:01:37 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2006-11-26 07:01:37 +0000 |
commit | 986c1f9deec5acf01fbb594db00b2ec174296c77 (patch) | |
tree | 5af2a32672ed628cae694291b970d37c4e0cadb0 /src/Text/Pandoc/Readers/HTML.hs | |
parent | e417ceaa8d7064ad81adbeabceb7204483aac1a5 (diff) | |
download | pandoc-986c1f9deec5acf01fbb594db00b2ec174296c77.tar.gz |
Pandoc bug fixes:
+ LaTeX reader did not parse metadata correctly. Now the title,
author, and date are parsed correctly, and everything else in
the preamble is skipped.
+ Simplified parsing of LaTeX command arguments and options.
The function commandArgs now returns a list of arguments OR
options (in whatever order they appear). The brackets are
included, and a new stripFirstAndLast function is provided
to strip them off when needed. This fixes a problem in dealing
with \newcommand, etc.
+ Added a "try" before "parser" in definition of notFollowedBy'
combinator. Adjusted the code using this combinator accordingly.
+ Changed handling of code blocks. Previously, some readers allowed
trailing newlines, while others stripped them. Now, all readers
strip trailing newlines in code blocks; writers insert a newline
at the end of code blocks as needed.
+ Changed test suite to reflect these changes.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@137 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Readers/HTML.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index 054d9eb72..f9a738e94 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -153,15 +153,15 @@ htmlScript = try (do rest <- manyTill anyChar (htmlEndTag "script") return (open ++ rest ++ "</script>")) -rawHtmlBlock = do - notFollowedBy (do {choice [htmlTag "/body", htmlTag "/html"]; return ' '}) +rawHtmlBlock = try (do + notFollowedBy' (choice [htmlTag "/body", htmlTag "/html"]) body <- choice [htmlScript, anyHtmlBlockTag, htmlComment, xmlDec, definition] sp <- (many space) state <- getState if stateParseRaw state then return (RawHtml (body ++ sp)) else - return Null + return Null) htmlComment = try (do string "<!--" @@ -284,12 +284,12 @@ preCodeBlock = try (do result <- manyTill anyChar (htmlEndTag "code") spaces htmlEndTag "pre" - return (CodeBlock (decodeEntities result))) + return (CodeBlock (stripTrailingNewlines (decodeEntities result)))) bareCodeBlock = try (do htmlTag "code" result <- manyTill anyChar (htmlEndTag "code") - return (CodeBlock (decodeEntities result))) + return (CodeBlock (stripTrailingNewlines (decodeEntities result)))) -- -- block quotes |