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:
parent
5932d905ff
commit
d4d5910e0a
1 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue