@@ -397,18 +397,18 @@ isBlockCommand s = maybe False (const True) $ M.lookup s blockCommands
397397
398398inlineCommands :: M.Map String (LP Inlines)
399399inlineCommands = M.fromList $
400− [ ("emph", emph <$> tok)
401− , ("textit", emph <$> tok)
402− , ("textsl", emph <$> tok)
403− , ("textsc", smallcaps <$> tok)
404− , ("sout", strikeout <$> tok)
405− , ("textsuperscript", superscript <$> tok)
406− , ("textsubscript", subscript <$> tok)
400+ [ ("emph", extractSpaces emph <$> tok)
401+ , ("textit", extractSpaces emph <$> tok)
402+ , ("textsl", extractSpaces emph <$> tok)
403+ , ("textsc", extractSpaces smallcaps <$> tok)
404+ , ("sout", extractSpaces strikeout <$> tok)
405+ , ("textsuperscript", extractSpaces superscript <$> tok)
406+ , ("textsubscript", extractSpaces subscript <$> tok)
407407 , ("textbackslash", lit "\\")
408408 , ("backslash", lit "\\")
409409 , ("slash", lit "/")
410− , ("textbf", strong <$> tok)
411− , ("textnormal", spanWith ("",["nodecor"],[]) <$> tok)
410+ , ("textbf", extractSpaces strong <$> tok)
411+ , ("textnormal", extractSpaces (spanWith ("",["nodecor"],[])) <$> tok)
412412 , ("ldots", lit "…")
413413 , ("dots", lit "…")
414414 , ("mdots", lit "…")
@@ -428,15 +428,15 @@ inlineCommands = M.fromList $
428428 , ("{", lit "{")
429429 , ("}", lit "}")
430430 -- old TeX commands
431− , ("em", emph <$> inlines)
432− , ("it", emph <$> inlines)
433− , ("sl", emph <$> inlines)
434− , ("bf", strong <$> inlines)
431+ , ("em", extractSpaces emph <$> inlines)
432+ , ("it", extractSpaces emph <$> inlines)
433+ , ("sl", extractSpaces emph <$> inlines)
434+ , ("bf", extractSpaces strong <$> inlines)
435435 , ("rm", inlines)
436− , ("itshape", emph <$> inlines)
437− , ("slshape", emph <$> inlines)
438− , ("scshape", smallcaps <$> inlines)
439− , ("bfseries", strong <$> inlines)
436+ , ("itshape", extractSpaces emph <$> inlines)
437+ , ("slshape", extractSpaces emph <$> inlines)
438+ , ("scshape", extractSpaces smallcaps <$> inlines)
439+ , ("bfseries", extractSpaces strong <$> inlines)
440440 , ("/", pure mempty) -- italic correction
441441 , ("aa", lit "å")
442442 , ("AA", lit "Å")