handle figure ids better

This commit is contained in:
Rhiannon Morris 2024-12-03 23:56:44 +01:00
parent ed54ec4c5a
commit c4a430facb

View file

@ -36,8 +36,10 @@ pluck1 (x:xs) ys = (x,) <$> pluck x ys <|> pluck1 xs ys
fixFigureClass :: Block -> Block fixFigureClass :: Block -> Block
fixFigureClass (Figure (_, c1, a1) cap [Plain [Image (i, c2, a2) alt path]]) = fixFigureClass (Figure (i1, c1, a1) cap [Plain [Image (i2, c2, a2) alt path]]) =
Figure (i, c1 ++ c2, a1 ++ a2) cap [Plain [Image ("", [], []) alt path]] Figure (iF, c1 ++ c2, a1 ++ a2) cap [Plain [Image (iI, [], []) alt path]]
where iF = if Text.null i1 then i2 else i1
iI = if Text.null i1 then "" else i2
fixFigureClass b = b fixFigureClass b = b
makeBlocks :: Block -> [Block] makeBlocks :: Block -> [Block]