HTML reader: Don't skip nonbreaking spaces.

Previously a paragraph containing just ` ` would be rendered
as an empty paragraph. Thanks to Paul Vorbach for pointing out the bug.
This commit is contained in:
John MacFarlane 2012-04-28 09:24:52 -07:00
parent 5932d905ff
commit d4d5910e0a

View file

@ -46,9 +46,15 @@ import Text.Pandoc.Shared
import Text.Pandoc.Parsing
import Data.Maybe ( fromMaybe, isJust )
import Data.List ( intercalate )
import Data.Char ( isSpace, isDigit, toLower )
import Data.Char ( isDigit, toLower )
import Control.Monad ( liftM, guard, when )
isSpace :: Char -> Bool
isSpace ' ' = True
isSpace '\t' = True
isSpace '\n' = True
isSpace _ = False
-- | Convert HTML-formatted string to 'Pandoc' document.
readHtml :: ParserState -- ^ Parser state
-> String -- ^ String to parse (assumes @'\n'@ line endings)