git.iko.soy/typeable/pandoc
on master help sign in
Changed comment used to replace unsafe HTML if sanitize-html option

selected. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1178 788f1e2b-df1e-0410-8736-df70ead52e1b

commit2df432dc60b104a63bd32bc10662303313b453f9 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateTue 8 Jan 2008, 04:53 (19 years ago) parent71e508f
1 file changed+4−4
Text/Pandoc/Readers/HTML.hs+4−4
Text/Pandoc/Readers/HTML.hs+4−4
@@ -159,7 +159,7 @@ anyHtmlTag = try $ do
159159 concatMap (\(_, _, raw) -> (' ':raw)) attribs ++ ender' ++ ">"
160160 unsanitary <- unsanitaryTag tag
161161 if unsanitary
162− then return $ "<!-- unsafe tag " ++ result ++ " omitted -->"
162+ then return $ "<!-- unsafe HTML removed -->"
163163 else return result
164164
165165anyHtmlEndTag = try $ do
@@ -173,7 +173,7 @@ anyHtmlEndTag = try $ do
173173 let result = "</" ++ tag ++ ">"
174174 unsanitary <- unsanitaryTag tag
175175 if unsanitary
176− then return $ "<!-- unsafe tag " ++ result ++ " omitted -->"
176+ then return $ "<!-- unsafe HTML removed -->"
177177 else return result
178178
179179htmlTag :: String -> GenParser Char ParserState (String, [(String, String)])
@@ -255,7 +255,7 @@ htmlScript = try $ do
255255 rest <- manyTill anyChar (htmlEndTag "script")
256256 st <- getState
257257 if stateSanitizeHTML st && not ("script" `elem` sanitaryTags)
258− then return "<!-- unsafe script omitted -->"
258+ then return "<!-- unsafe HTML removed -->"
259259 else return $ open ++ rest ++ "</script>"
260260
261261-- | Parses material between style tags.
@@ -265,7 +265,7 @@ htmlStyle = try $ do
265265 rest <- manyTill anyChar (htmlEndTag "style")
266266 st <- getState
267267 if stateSanitizeHTML st && not ("style" `elem` sanitaryTags)
268− then return "<!-- unsafe style omitted -->"
268+ then return "<!-- unsafe HTML removed -->"
269269 else return $ open ++ rest ++ "</style>"
270270
271271htmlBlockElement = choice [ htmlScript, htmlStyle, htmlComment, xmlDec, definition ]