@@ -51,7 +51,7 @@ import Text.Pandoc.Options (ReaderOptions(readerParseRaw, readerTrace)
5151import Text.Pandoc.Parsing hiding ((<|>))
5252import Text.Pandoc.Walk
5353import Data.Maybe ( fromMaybe, isJust)
54−import Data.List ( intercalate, isInfixOf, isPrefixOf )
54+import Data.List ( intercalate, isInfixOf, isPrefixOf, isSuffixOf )
5555import Data.Char ( isDigit )
5656import Control.Monad ( liftM, guard, when, mzero, void, unless )
5757import Control.Arrow ((***))
@@ -874,7 +874,7 @@ htmlInBalanced :: (Monad m)
874874 -> ParserT String st m String
875875htmlInBalanced f = try $ do
876876 (TagOpen t _, tag) <- htmlTag f
877− guard $ '/' `notElem` tag -- not a self-closing tag
877+ guard $ not $ "/>" `isSuffixOf` tag -- not a self-closing tag
878878 let stopper = htmlTag (~== TagClose t)
879879 let anytag = snd <$> htmlTag (const True)
880880 contents <- many $ notFollowedBy' stopper >>