@@ -343,7 +343,7 @@ setCaption :: LP Blocks
343setCaption = do
343setCaption = do
344 ils <- tok
344 ils <- tok
345 mblabel <- option Nothing $
345 mblabel <- option Nothing $
346− try $ spaces >> controlSeq "label" >> (Just <$> tok)
346+ try $ spaces' >> controlSeq "label" >> (Just <$> tok)
347 let ils' = case mblabel of
347 let ils' = case mblabel of
348 Just lab -> ils <> spanWith
348 Just lab -> ils <> spanWith
349 ("",[],[("data-label", stringify lab)]) mempty
349 ("",[],[("data-label", stringify lab)]) mempty
@@ -371,7 +371,7 @@ section (ident, classes, kvs) lvl = do
371 let lvl' = if hasChapters then lvl + 1 else lvl
371 let lvl' = if hasChapters then lvl + 1 else lvl
373 contents <- grouped inline
373 contents <- grouped inline
374− lab <- option ident $ try (spaces >> controlSeq "label" >> spaces >> braced)
374+ lab <- option ident $ try (spaces' >> controlSeq "label" >> spaces' >> braced)
375 attr' <- registerHeader (lab, classes, kvs) contents
375 attr' <- registerHeader (lab, classes, kvs) contents
376 return $ headerWith attr' lvl' contents
376 return $ headerWith attr' lvl' contents
@@ -497,7 +497,7 @@ inlineCommands = M.fromList $
497 , ("v", option (str "v") $ try $ tok >>= accent hacek)
497 , ("v", option (str "v") $ try $ tok >>= accent hacek)
498 , ("u", option (str "u") $ try $ tok >>= accent breve)
498 , ("u", option (str "u") $ try $ tok >>= accent breve)
499 , ("i", lit "i")
499 , ("i", lit "i")
500− , ("\\", linebreak <$ (optional (bracketed inline) *> optional sp))
500+ , ("\\", linebreak <$ (optional (bracketed inline) *> spaces'))
501 , (",", pure mempty)
501 , (",", pure mempty)
502 , ("@", pure mempty)
502 , ("@", pure mempty)
503 , (" ", lit "\160")
503 , (" ", lit "\160")
@@ -1291,13 +1291,13 @@ parseAligns = try $ do
1291 return aligns'
1291 return aligns'
1293hline :: LP ()
1293hline :: LP ()
1294−hline = () <$ (try $ spaces >> controlSeq "hline")
1294+hline = () <$ (try $ spaces' *> controlSeq "hline" <* spaces')
1296lbreak :: LP ()
1296lbreak :: LP ()
1297−lbreak = () <$ (try $ spaces *> controlSeq "\\")
1297+lbreak = () <$ (try $ spaces' *> controlSeq "\\" <* spaces')
1299amp :: LP ()
1299amp :: LP ()
1300−amp = () <$ (try $ spaces *> char '&')
1300+amp = () <$ (try $ spaces' *> char '&')
1302parseTableRow :: Int -- ^ number of columns
1302parseTableRow :: Int -- ^ number of columns
1303 -> LP [Blocks]
1303 -> LP [Blocks]
@@ -1310,20 +1310,22 @@ parseTableRow cols = try $ do
1310 guard $ cells' /= [mempty]
1310 guard $ cells' /= [mempty]
1311 -- note: a & b in a three-column table leaves an empty 3rd cell:
1311 -- note: a & b in a three-column table leaves an empty 3rd cell:
1312 let cells'' = cells' ++ replicate (cols - numcells) mempty
1312 let cells'' = cells' ++ replicate (cols - numcells) mempty
1313− spaces
1313+ spaces'
1314 return cells''
1314 return cells''
1317+spaces' = spaces *> skipMany (comment *> spaces)
1316simpTable :: Bool -> LP Blocks
1319simpTable :: Bool -> LP Blocks
1317simpTable hasWidthParameter = try $ do
1320simpTable hasWidthParameter = try $ do
1318− when hasWidthParameter $ () <$ (spaces >> tok)
1321+ when hasWidthParameter $ () <$ (spaces' >> tok)
1319 skipopts
1322 skipopts
1320 aligns <- parseAligns
1323 aligns <- parseAligns
1321 let cols = length aligns
1324 let cols = length aligns
1322 optional hline
1325 optional hline
1323 header' <- option [] $ try (parseTableRow cols <* lbreak <* hline)
1326 header' <- option [] $ try (parseTableRow cols <* lbreak <* hline)
1324 rows <- sepEndBy (parseTableRow cols) (lbreak <* optional hline)
1327 rows <- sepEndBy (parseTableRow cols) (lbreak <* optional hline)
1325− spaces
1328+ spaces'
1326− skipMany (comment *> spaces)
1327 let header'' = if null header'
1329 let header'' = if null header'
1328 then replicate cols mempty
1330 then replicate cols mempty
1329 else header'
1331 else header'