aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-24 19:40:32 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-24 19:40:32 +0000
commit8f0cfe9bd055e91398b642a14b0faeeb5f431ebb (patch)
tree5bbfd590487fe16bb646d520747e2fd71c95f699 /src/Text/Pandoc
parentc61f2b6984c8855c0da7df10fd83e40332223f48 (diff)
downloadpandoc-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/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs8
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