diff --git a/INSTALL b/INSTALL
--- a/INSTALL
+++ b/INSTALL
@@ -40,6 +40,15 @@
 
         make test
 
+    Note: if you see errors like the following, they're due to differences
+    between different versions of the xhtml library, and can safely be
+    disregarded:
+
+        2c2
+        < <html xmlns="http://www.w3.org/1999/xhtml"
+        ---
+        > <html
+
 4.  Install:
 
         sudo make install
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,38 @@
+pandoc (0.41) unstable; urgency=low
+
+  [ John MacFarlane ]
+
+  * Fixed bugs in HTML reader:
+    + Skip material at end *only if* </html> is present (previously,
+      only part of the document would be parsed if an error was
+      found; now a proper error message is given).
+    + Added new constant eitherBlockOrInline with elements that may
+      count either as block-level or as inline. Modified isInline and
+      isBlock to take this into account.
+    + Modified rawHtmlBlock to accept any tag (even an inline tag):
+      this is innocuous, because rawHtmlBlock is tried only if a regular
+      inline element can't be parsed.
+    + Added a necessary 'try' in definition of 'para'.
+
+  * Fixed bug in markdown ordered list parsing.  The problem was that
+    anyOrderedListStart did not check for a space following the
+    ordered list marker.  So in 'A.B. 2007' the parser would be
+    expecting a list item, but would not find one, causing an error.
+    Fixed a similar bug in the RST reader.  Resolves Issue #22.
+
+  * Refactored RST and Markdown readers using parseFromString.
+
+  * LaTeX reader will now skip anything after \end{document}.
+
+  * Fixed blockquote output in markdown writer: previously, block
+    quotes in indented contexts would be indented only in the first
+    line.
+
+  * Added note to INSTALL about variations in versions of the xhtml
+    library that can lead to failed tests (thanks to Leif LeBaron).
+
+ -- John MacFarlane <jgm@berkeley.edu>  Sun, 19 Aug 2007 00:00:00 -0400
+
 pandoc (0.4) unstable; urgency=low
 
   [ John MacFarlane ]
@@ -404,7 +439,6 @@
       libghc6-xhtml-dev.  Removed libghc6-html-dev.
     + Suggest texlive-latex-recommended | tetex-extra instead of
       tetex-bin.  This brings in fancyvrb and unicode support.
-
 
  -- Recai Oktaş <roktas@debian.org>  Tue, 16 Jan 2007 00:37:21 +0200
 
diff --git a/pandoc.cabal b/pandoc.cabal
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -1,5 +1,5 @@
 Name:            pandoc
-Version:         0.4
+Version:         0.41
 License:         GPL
 License-File:    COPYING
 Copyright:       (c) 2006-2007 John MacFarlane
diff --git a/src/Main.hs b/src/Main.hs
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -43,7 +43,7 @@
 import Control.Monad ( (>>=) )
 
 version :: String
-version = "0.4"
+version = "0.41"
 
 copyrightMessage :: String
 copyrightMessage = "\nCopyright (C) 2006-7 John MacFarlane\n\
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -59,12 +59,22 @@
 -- Constants
 --
 
+eitherBlockOrInline = ["applet", "button", "del", "iframe", "ins",
+                  "map", "area", "object", "script"]
+
 inlineHtmlTags = ["a", "abbr", "acronym", "b", "basefont", "bdo", "big",
                   "br", "cite", "code", "dfn", "em", "font", "i", "img",
                   "input", "kbd", "label", "q", "s", "samp", "select",
                   "small", "span", "strike", "strong", "sub", "sup",
-                  "textarea", "tt", "u", "var"]
+                  "textarea", "tt", "u", "var"] ++ eitherBlockOrInline
 
+blockHtmlTags = ["address", "blockquote", "center", "dir", "div",
+                 "dl", "fieldset", "form", "h1", "h2", "h3", "h4",
+                 "h5", "h6", "hr", "isindex", "menu", "noframes",
+                 "noscript", "ol", "p", "pre", "table", "ul", "dd",
+                 "dt", "frameset", "li", "tbody", "td", "tfoot",
+                 "th", "thead", "tr"] ++ eitherBlockOrInline
+
 --
 -- HTML utility functions
 --
@@ -171,12 +181,15 @@
   char '>'
   return $ "</" ++ tag ++ ">"
 
--- | Returns @True@ if the tag is an inline tag.
+-- | Returns @True@ if the tag is (or can be) an inline tag.
 isInline tag = (extractTagType tag) `elem` inlineHtmlTags
 
+-- | Returns @True@ if the tag is (or can be) a block tag.
+isBlock tag = (extractTagType tag) `elem` blockHtmlTags 
+
 anyHtmlBlockTag = try $ do
   tag <- anyHtmlTag <|> anyHtmlEndTag
-  if isInline tag then fail "inline tag" else return tag
+  if isBlock tag then return tag else fail "inline tag"
 
 anyHtmlInlineTag = try $ do
   tag <- anyHtmlTag <|> anyHtmlEndTag
@@ -193,7 +206,7 @@
 
 rawHtmlBlock = try $ do
   notFollowedBy' (htmlTag "/body" <|> htmlTag "/html")
-  body <- htmlBlockElement <|> anyHtmlBlockTag
+  body <- htmlBlockElement <|> anyHtmlTag <|> anyHtmlEndTag
   sp <- many space
   state <- getState
   if stateParseRaw state then return (RawHtml (body ++ sp)) else return Null
@@ -260,8 +273,7 @@
   spaces
   optional (htmlEndTag "body")
   spaces
-  optional (htmlEndTag "html")
-  many anyChar -- ignore anything after </html>
+  optional (htmlEndTag "html" >> many anyChar) -- ignore anything after </html>
   eof
   return $ Pandoc (Meta title authors date) blocks
 
@@ -383,7 +395,8 @@
 -- paragraph block
 --
 
-para = htmlTag "p" >> inlinesTilEnd "p" >>= return . Para . normalizeSpaces
+para = try $ htmlTag "p" >> inlinesTilEnd "p" >>= 
+             return . Para . normalizeSpaces
 
 -- 
 -- plain block
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -117,7 +117,8 @@
   spaces
   blocks <- parseBlocks
   spaces
-  optional $ try (string "\\end{document}") -- might not be present (fragment)
+  optional $ try (string "\\end{document}" >> many anyChar) 
+  -- might not be present (fragment)
   spaces
   eof
   state <- getState
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -195,10 +195,7 @@
   raw <- sepBy rawLines (try (blankline >> indentSpaces))
   optional blanklines
   -- parse the extracted text, which may contain various block elements:
-  rest <- getInput
-  setInput $ (joinWithSep "\n" raw) ++ "\n\n"
-  contents <- parseBlocks
-  setInput rest
+  contents <- parseFromString parseBlocks $ (joinWithSep "\n" raw) ++ "\n\n"
   return $ NoteBlock ref contents
 
 --
@@ -307,10 +304,7 @@
 blockQuote = do 
   raw <- emailBlockQuote <|> emacsBoxQuote
   -- parse the extracted block, which may contain various block elements:
-  rest <- getInput
-  setInput $ (joinWithSep "\n" raw) ++ "\n\n"
-  contents <- parseBlocks
-  setInput rest
+  contents <- parseFromString parseBlocks $ (joinWithSep "\n" raw) ++ "\n\n"
   return $ BlockQuote contents
  
 --
@@ -334,8 +328,9 @@
   if stateStrict state
      then do many1 digit
              char '.'
+             spaceChar
              return (1, DefaultStyle, DefaultDelim)
-     else anyOrderedListMarker
+     else anyOrderedListMarker >>~ spaceChar
 
 orderedListStart style delim = try $ do
   optional newline -- if preceded by a Plain block in a list context
@@ -346,7 +341,7 @@
              char '.'
              return 1
      else orderedListMarker style delim 
-  oneOf spaceChars
+  spaceChar
   skipSpaces
 
 -- parse a line of a list item (start = parser for beginning of list item)
@@ -392,11 +387,8 @@
   let oldContext = stateParserContext state
   setState $ state {stateParserContext = ListItemState}
   -- parse the extracted block, which may contain various block elements:
-  rest <- getInput
   let raw = concat (first:continuations)
-  setInput raw
-  contents <- parseBlocks
-  setInput rest
+  contents <- parseFromString parseBlocks raw
   updateState (\st -> st {stateParserContext = oldContext})
   return contents
 
@@ -418,10 +410,7 @@
   state <- getState
   let oldContext = stateParserContext state
   -- parse the extracted block, which may contain various block elements:
-  rest <- getInput
-  setInput (concat raw)
-  contents <- parseBlocks
-  setInput rest
+  contents <- parseFromString parseBlocks $ concat raw
   updateState (\st -> st {stateParserContext = oldContext})
   return ((normalizeSpaces term), contents)
 
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -328,10 +328,7 @@
 blockQuote = try $ do
   raw <- indentedBlock True
   -- parse the extracted block, which may contain various block elements:
-  rest <- getInput
-  setInput $ raw ++ "\n\n"
-  contents <- parseBlocks
-  setInput rest
+  contents <- parseFromString parseBlocks $ raw ++ "\n\n"
   return $ BlockQuote contents
 
 --
@@ -344,10 +341,7 @@
   term <- many1Till inline endline
   raw <- indentedBlock True
   -- parse the extracted block, which may contain various block elements:
-  rest <- getInput
-  setInput $ raw ++ "\n\n"
-  contents <- parseBlocks
-  setInput rest
+  contents <- parseFromString parseBlocks $ raw ++ "\n\n"
   return (normalizeSpaces term, contents)
 
 definitionList = try $ do
@@ -408,17 +402,14 @@
   -- see definition of "endline"
   state <- getState
   let oldContext = stateParserContext state
-  remaining <- getInput
   setState $ state {stateParserContext = ListItemState}
   -- parse the extracted block, which may itself contain block elements
-  setInput $ concat (first:rest) ++ blanks
-  parsed <- parseBlocks
-  setInput remaining 
+  parsed <- parseFromString parseBlocks $ concat (first:rest) ++ blanks
   updateState (\st -> st {stateParserContext = oldContext})
   return parsed
 
 orderedList = try $ do
-  (start, style, delim) <- lookAhead anyOrderedListMarker 
+  (start, style, delim) <- lookAhead (anyOrderedListMarker >>~ spaceChar)
   items <- many1 (listItem (orderedListStart style delim))
   let items' = compactify items
   return $ OrderedList (start, style, delim) items'
@@ -551,7 +542,8 @@
   -- parse potential list-starts at beginning of line differently in a list:
   st <- getState
   if ((stateParserContext st) == ListItemState)
-     then notFollowedBy' anyOrderedListMarker >> notFollowedBy' bulletListStart
+     then notFollowedBy (anyOrderedListMarker >> spaceChar) >>
+          notFollowedBy' bulletListStart
      else return ()
   return Space
 
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -91,8 +91,8 @@
 
 -- | Return markdown representation of a note.
 noteToMarkdown :: WriterOptions -> Int -> [Block] -> State WriterState Doc
-noteToMarkdown opts num note = do
-  contents <- blockListToMarkdown opts note
+noteToMarkdown opts num blocks = do
+  contents  <- blockListToMarkdown opts blocks
   let marker = text "[^" <> text (show num) <> text "]:"
   return $ hang marker (writerTabStop opts) contents 
 
@@ -163,8 +163,8 @@
   (nest (writerTabStop opts) $ vcat $ map text (lines str)) <> text "\n"
 blockToMarkdown opts (BlockQuote blocks) = do
   contents <- blockListToMarkdown opts blocks
-  let quotedContents = unlines $ map ("> " ++) $ lines $ render contents
-  return $ text quotedContents 
+  return $ (vcat $ map (text . ("> " ++)) $ lines $ render contents) <> 
+           text "\n"
 blockToMarkdown opts (Table caption aligns widths headers rows) =  do
   caption' <- inlineListToMarkdown opts caption
   let caption'' = if null caption
diff --git a/tests/testsuite.native b/tests/testsuite.native
--- a/tests/testsuite.native
+++ b/tests/testsuite.native
@@ -178,6 +178,8 @@
     , OrderedList (1,DefaultStyle,DefaultDelim)
       [ [ Plain [Str "Nested",Str "."] ]
      ] ] ]
+, Para [Str "Should",Space,Str "not",Space,Str "be",Space,Str "a",Space,Str "list",Space,Str "item:"]
+, Para [Str "M",Str ".",Str "A",Str ".",Space,Str "2007"]
 , HorizontalRule
 , Header 1 [Str "Definition",Space,Str "Lists"]
 , Para [Str "Tight",Space,Str "using",Space,Str "spaces:"]
diff --git a/tests/testsuite.txt b/tests/testsuite.txt
--- a/tests/testsuite.txt
+++ b/tests/testsuite.txt
@@ -281,6 +281,10 @@
  #.  More.
      #.  Nested.
 
+Should not be a list item:
+
+M.A. 2007
+
   *   *   *   *   *
 
 # Definition Lists
diff --git a/tests/writer.context b/tests/writer.context
--- a/tests/writer.context
+++ b/tests/writer.context
@@ -399,6 +399,10 @@
 \item Nested.
 \stopltxenum
 \stopltxenum
+Should not be a list item:
+
+M.A. 2007
+
 \thinrule
 
 \section{Definition Lists}
diff --git a/tests/writer.docbook b/tests/writer.docbook
--- a/tests/writer.docbook
+++ b/tests/writer.docbook
@@ -642,6 +642,12 @@
           </orderedlist>
         </listitem>
       </orderedlist>
+      <para>
+        Should not be a list item:
+      </para>
+      <para>
+        M.A. 2007
+      </para>
     </section>
   </section>
   <section>
diff --git a/tests/writer.html b/tests/writer.html
--- a/tests/writer.html
+++ b/tests/writer.html
@@ -449,6 +449,10 @@
 	  ></ol
 	></li
       ></ol
+    ><p
+    >Should not be a list item:</p
+    ><p
+    >M.A. 2007</p
     ><hr
      /><h1 id="definition-lists"
     >Definition Lists</h1
diff --git a/tests/writer.latex b/tests/writer.latex
--- a/tests/writer.latex
+++ b/tests/writer.latex
@@ -345,6 +345,10 @@
 \item Nested.
 \end{enumerate}
 \end{enumerate}
+Should not be a list item:
+
+M.A. 2007
+
 \begin{center}\rule{3in}{0.4pt}\end{center}
 
 \section{Definition Lists}
diff --git a/tests/writer.man b/tests/writer.man
--- a/tests/writer.man
+++ b/tests/writer.man
@@ -322,6 +322,10 @@
 Nested\.
 .RE
 .PP
+Should not be a list item:
+.PP
+M\.A\. 2007
+.PP
    *   *   *   *   *
 .SH Definition Lists
 .PP
diff --git a/tests/writer.markdown b/tests/writer.markdown
--- a/tests/writer.markdown
+++ b/tests/writer.markdown
@@ -284,6 +284,10 @@
     1.  Nested.
 
 
+Should not be a list item:
+
+M.A. 2007
+
 
 * * * * *
 
diff --git a/tests/writer.native b/tests/writer.native
--- a/tests/writer.native
+++ b/tests/writer.native
@@ -178,6 +178,8 @@
     , OrderedList (1,DefaultStyle,DefaultDelim)
       [ [ Plain [Str "Nested",Str "."] ]
      ] ] ]
+, Para [Str "Should",Space,Str "not",Space,Str "be",Space,Str "a",Space,Str "list",Space,Str "item:"]
+, Para [Str "M",Str ".",Str "A",Str ".",Space,Str "2007"]
 , HorizontalRule
 , Header 1 [Str "Definition",Space,Str "Lists"]
 , Para [Str "Tight",Space,Str "using",Space,Str "spaces:"]
diff --git a/tests/writer.rst b/tests/writer.rst
--- a/tests/writer.rst
+++ b/tests/writer.rst
@@ -348,6 +348,10 @@
     #. Nested.
 
 
+Should not be a list item:
+
+M.A. 2007
+
 --------------
 
 Definition Lists
diff --git a/tests/writer.rtf b/tests/writer.rtf
--- a/tests/writer.rtf
+++ b/tests/writer.rtf
@@ -157,6 +157,8 @@
 {\pard \ql \f0 \sa0 \li360 \fi-360 1.\tx360\tab Autonumber.\par}
 {\pard \ql \f0 \sa0 \li360 \fi-360 2.\tx360\tab More.\par}
 {\pard \ql \f0 \sa0 \li720 \fi-360 a.\tx360\tab Nested.\sa180\sa180\par}
+{\pard \ql \f0 \sa180 \li0 \fi0 Should not be a list item:\par}
+{\pard \ql \f0 \sa180 \li0 \fi0 M.A. 2007\par}
 {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par}
 {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Definition Lists\par}
 {\pard \ql \f0 \sa180 \li0 \fi0 Tight using spaces:\par}
diff --git a/web/highlight.css b/web/highlight.css
new file mode 100644
--- /dev/null
+++ b/web/highlight.css
@@ -0,0 +1,20 @@
+/* Style definition file generated by highlight 2.4.8, http://www.andre-simon.de/ */
+
+/* Highlighting theme definition: */
+
+body.hl	{ background-color:#ffffff; }
+pre.hl	{ color:#000000; background-color:#ffffff; font-size:10pt; font-family: monospace;}
+.num	{ color:#000000; }
+.esc	{ color:#bd8d8b; }
+.str	{ color:#bd8d8b; }
+.dstr	{ color:#bd8d8b; }
+.slc	{ color:#ac2020; font-style:italic; }
+.com	{ color:#ac2020; font-style:italic; }
+.dir	{ color:#000000; }
+.sym	{ color:#000000; }
+.line	{ color:#555555; }
+.kwa	{ color:#9c20ee; font-weight:bold; }
+.kwb	{ color:#208920; }
+.kwc	{ color:#0000ff; }
+.kwd	{ color:#000000; }
+
