LaTeX.hs (pandoc-2.11.1.1) | : | LaTeX.hs (pandoc-2.11.2) | ||
---|---|---|---|---|
skipping to change at line 1920 | skipping to change at line 1920 | |||
("", _, _) -> return () | ("", _, _) -> return () | |||
(ident, _, _) -> do | (ident, _, _) -> do | |||
num <- getNextNumber sLastFigureNum | num <- getNextNumber sLastFigureNum | |||
setState | setState | |||
st{ sLastFigureNum = num | st{ sLastFigureNum = num | |||
, sLabels = M.insert ident | , sLabels = M.insert ident | |||
[Str (renderDottedNum num)] (sLabels st) } | [Str (renderDottedNum num)] (sLabels st) } | |||
return $ Image attr' alt' (src, tit') | return $ Image attr' alt' (src, tit') | |||
go x = return x | go x = return x | |||
getNextNumber :: Monad m | ||||
=> (LaTeXState -> DottedNum) -> LP m DottedNum | ||||
getNextNumber getCurrentNum = do | ||||
st <- getState | ||||
let chapnum = | ||||
case sLastHeaderNum st of | ||||
DottedNum (n:_) | sHasChapters st -> Just n | ||||
_ -> Nothing | ||||
return . DottedNum $ | ||||
case getCurrentNum st of | ||||
DottedNum [m,n] -> | ||||
case chapnum of | ||||
Just m' | m' == m -> [m, n+1] | ||||
| otherwise -> [m', 1] | ||||
Nothing -> [1] | ||||
-- shouldn't happen | ||||
DottedNum [n] -> | ||||
case chapnum of | ||||
Just m -> [m, 1] | ||||
Nothing -> [n + 1] | ||||
_ -> | ||||
case chapnum of | ||||
Just n -> [n, 1] | ||||
Nothing -> [1] | ||||
coloredBlock :: PandocMonad m => Text -> LP m Blocks | coloredBlock :: PandocMonad m => Text -> LP m Blocks | |||
coloredBlock stylename = try $ do | coloredBlock stylename = try $ do | |||
skipopts | skipopts | |||
color <- braced | color <- braced | |||
notFollowedBy (grouped inline) | notFollowedBy (grouped inline) | |||
let constructor = divWith ("",[],[("style",stylename <> ": " <> untokenize col or)]) | let constructor = divWith ("",[],[("style",stylename <> ": " <> untokenize col or)]) | |||
constructor <$> grouped block | constructor <$> grouped block | |||
graphicsPath :: PandocMonad m => LP m Blocks | graphicsPath :: PandocMonad m => LP m Blocks | |||
graphicsPath = do | graphicsPath = do | |||
End of changes. 1 change blocks. | ||||
25 lines changed or deleted | 0 lines changed or added |