@@ -420,6 +420,11 @@ endsWithSpace [SoftBreak] = True
420420endsWithSpace (_:xs) = endsWithSpace xs
421421endsWithSpace [] = False
422422
423+emptyInlines :: [Inline] -> Bool
424+emptyInlines [] = True
425+emptyInlines (Str "":xs) = emptyInlines xs
426+emptyInlines _ = False
427+
423428urlEscapeBrackets :: String -> String
424429urlEscapeBrackets (']':xs) = '%':'5':'D':urlEscapeBrackets xs
425430urlEscapeBrackets (x:xs) = x:urlEscapeBrackets xs
@@ -517,7 +522,7 @@ inlineToMuse (Emph [Strong lst]) = do
517522 then do contents <- local (\env -> env { envInsideAsterisks = True }) $ inlineListToMuse lst
518523 modify $ \st -> st { stUseTags = False }
519524 return $ "<em>**" <> contents <> "**</em>"
520− else if null lst || startsWithSpace lst || endsWithSpace lst
525+ else if emptyInlines lst || startsWithSpace lst || endsWithSpace lst
521526 then do
522527 contents <- local (\env -> env { envInsideAsterisks = False }) $ inlineListToMuse lst
523528 modify $ \st -> st { stUseTags = True }
@@ -528,7 +533,7 @@ inlineToMuse (Emph [Strong lst]) = do
528533 return $ "***" <> contents <> "***"
529534inlineToMuse (Emph lst) = do
530535 useTags <- gets stUseTags
531− if useTags || null lst || startsWithSpace lst || endsWithSpace lst
536+ if useTags || emptyInlines lst || startsWithSpace lst || endsWithSpace lst
532537 then do contents <- inlineListToMuse lst
533538 return $ "<em>" <> contents <> "</em>"
534539 else do contents <- local (\env -> env { envInsideAsterisks = True }) $ inlineListToMuse lst
@@ -540,7 +545,7 @@ inlineToMuse (Strong [Emph lst]) = do
540545 then do contents <- local (\env -> env { envInsideAsterisks = True }) $ inlineListToMuse lst
541546 modify $ \st -> st { stUseTags = False }
542547 return $ "<strong>*" <> contents <> "*</strong>"
543− else if null lst || startsWithSpace lst || endsWithSpace lst
548+ else if emptyInlines lst || startsWithSpace lst || endsWithSpace lst
544549 then do
545550 contents <- local (\env -> env { envInsideAsterisks = False }) $ inlineListToMuse lst
546551 modify $ \st -> st { stUseTags = True }
@@ -551,7 +556,7 @@ inlineToMuse (Strong [Emph lst]) = do
551556 return $ "***" <> contents <> "***"
552557inlineToMuse (Strong lst) = do
553558 useTags <- gets stUseTags
554− if useTags || null lst || startsWithSpace lst || endsWithSpace lst
559+ if useTags || emptyInlines lst || startsWithSpace lst || endsWithSpace lst
555560 then do contents <- inlineListToMuse lst
556561 modify $ \st -> st { stUseTags = False }
557562 return $ "<strong>" <> contents <> "</strong>"