aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 43165ceb1..0c017b2e4 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -46,7 +46,7 @@ import Text.Pandoc.Shared
import Text.Pandoc.Parsing
import Data.Maybe ( fromMaybe, isJust )
import Data.List ( intercalate )
-import Data.Char ( isSpace, isDigit )
+import Data.Char ( isSpace, isDigit, toLower )
import Control.Monad ( liftM, guard, when )
-- | Convert HTML-formatted string to 'Pandoc' document.
@@ -90,9 +90,17 @@ block = choice
, pRawHtmlBlock
]
+-- repeated in SelfContained -- consolidate eventually
renderTags' :: [Tag String] -> String
renderTags' = renderTagsOptions
- renderOptions{ optMinimize = (`elem` ["hr","br","img"]) }
+ renderOptions{ optMinimize = \x ->
+ let y = map toLower x
+ in y == "hr" || y == "br" ||
+ y == "img" || y == "meta" ||
+ y == "link"
+ , optRawTag = \x ->
+ let y = map toLower x
+ in y == "script" || y == "style" }
pList :: TagParser [Block]
pList = pBulletList <|> pOrderedList <|> pDefinitionList