diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-01-24 19:40:32 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-01-24 19:40:32 +0000 |
commit | 8f0cfe9bd055e91398b642a14b0faeeb5f431ebb (patch) | |
tree | 5bbfd590487fe16bb646d520747e2fd71c95f699 /src | |
parent | c61f2b6984c8855c0da7df10fd83e40332223f48 (diff) | |
download | pandoc-8f0cfe9bd055e91398b642a14b0faeeb5f431ebb.tar.gz |
Fixed a bug in extractTagType in HTML Reader: the previous
version extracted the attributes, too, which is not wanted.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@510 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index 8f8822d01..975e79388 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -46,7 +46,7 @@ import Text.Pandoc.Definition import Text.Pandoc.Shared import Text.Pandoc.Entities ( decodeEntities, entityToChar ) import Maybe ( fromMaybe ) -import Char ( toUpper, toLower ) +import Data.Char ( toUpper, toLower, isAlphaNum ) -- | Convert HTML-formatted string to 'Pandoc' document. readHtml :: ParserState -- ^ Parser state @@ -84,11 +84,7 @@ inlinesTilEnd tag = try (do -- | Extract type from a tag: e.g. 'br' from '<br>' extractTagType :: String -> String -extractTagType "" = "" -extractTagType ('<':rest) = - if (not (null rest)) && (last rest == '>') - then map toLower $ removeLeadingTrailingSpace (init rest) - else "" +extractTagType ('<':rest) = map toLower $ takeWhile isAlphaNum rest extractTagType _ = "" -- | Parse any HTML tag (closing or opening) and return text of tag |