git.iko.soy/typeable/pandoc
on master help sign in
Count anything that isn't a known block (HTML) tag as an inline tag

(rather than the other way around). Added "html", "head", and "body" to list of block tags. Resolves Issue #66, allowing <lj> to count as an inline tag. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1276 788f1e2b-df1e-0410-8736-df70ead52e1b

commit6a46ffc0ad3d3ef5c4426d0e726f40dda1bfaf38 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 20 Apr 2008, 03:12 (19 years ago) parent2fdcd17
1 file changed+4−4
Text/Pandoc/Readers/HTML.hs+4−4
Text/Pandoc/Readers/HTML.hs+4−4
@@ -69,9 +69,9 @@ inlineHtmlTags = ["a", "abbr", "acronym", "b", "basefont", "bdo", "big",
6969 "small", "span", "strike", "strong", "sub", "sup",
7070 "textarea", "tt", "u", "var"] ++ eitherBlockOrInline
7171
72−blockHtmlTags = ["address", "blockquote", "center", "dir", "div",
72+blockHtmlTags = ["address", "blockquote", "body", "center", "dir", "div",
7373 "dl", "fieldset", "form", "h1", "h2", "h3", "h4",
74− "h5", "h6", "hr", "isindex", "menu", "noframes",
74+ "h5", "h6", "hr", "html", "isindex", "menu", "noframes",
7575 "noscript", "ol", "p", "pre", "table", "ul", "dd",
7676 "dt", "frameset", "li", "tbody", "td", "tfoot",
7777 "th", "thead", "tr", "script"] ++ eitherBlockOrInline
@@ -257,11 +257,11 @@ isBlock tag = (extractTagType tag) `elem` blockHtmlTags
257257
258258anyHtmlBlockTag = try $ do
259259 tag <- anyHtmlTag <|> anyHtmlEndTag
260− if not (isInline tag) then return tag else fail "not a block tag"
260+ if isBlock tag then return tag else fail "not a block tag"
261261
262262anyHtmlInlineTag = try $ do
263263 tag <- anyHtmlTag <|> anyHtmlEndTag
264− if isInline tag then return tag else fail "not an inline tag"
264+ if not (isBlock tag) then return tag else fail "not an inline tag"
265265
266266-- | Parses material between script tags.
267267-- Scripts must be treated differently, because they can contain '<>' etc.