From 8f0cfe9bd055e91398b642a14b0faeeb5f431ebb Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Wed, 24 Jan 2007 19:40:32 +0000 Subject: 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 --- src/Text/Pandoc/Readers/HTML.hs | 8 ++------ 1 file 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 '
' 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 -- cgit v1.2.3